-
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.
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.
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…