-
hello everyone, i want to ask a question about odoo 17. from odoo import api, fields, models, _, Command |
Beta Was this translation helpful? Give feedback.
Answered by
luisg123v
Mar 12, 2024
Replies: 1 comment 1 reply
-
Starting from Odoo 15.0, the Command syntax is the preferred way to set values to For instance, instead of:
We would do:
Note that this syntax also works in XML, e.g.:
Here is how to translate from the old syntax to the new one:
For more information, you may check the Command class documentation I hope this helps. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
it12uw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starting from Odoo 15.0, the Command syntax is the preferred way to set values to
One2many
andMany2many
fields when creating or writing to records, instead of using numeric commands.For instance, instead of:
We would do:
Note that this syntax also works in XML, e.g.:
Here is how to translate from the old syntax to the new one:
(0, 0, {...})
Command.create({...})
(1, id, {...})
Command.update(id, {...})
(2, id)
Command.delete(id)
(3, id)
Command.unlink(id)
(4…