In Odoo 16 and previous versions, it was very easy to use Automated Actions to create a record in a linked Model and set fields. For example, to create an Analytic Account for a Sales Order in Odoo 15:
In Odoo 17, Automation Rules allow you to create a linked record, but do not allow you to set other fields. So it will fail when trying to create an Analytic Account because it needs some fields to be set (including the Plan).
It is possible to write Python code for some of this, though (not being a Python programmer) I can't figure out how to create an Analytic Account and link it to the sales order.
Similar problem if you want to update multiple fields or use a Python expression rather than set a fixed value.
Also (as discussed elsewhere), only some triggers can be selected, though all of them still seem to be there!
Are these "improvements" because Automated Actions were too powerful or was it overlooked? Or is there a solution I am missing?
I hope it was only be overlooked and that it will be a solution/fix soon!
For reference: https://github.com/odoo/odoo/pull/114352
Hello,
can I ask if you use a execute code , do I have to have the custome plan ? if I am using odoo standard how can I create a new recored
Help - I've been trying to create this but even with Ray's work around we still get an error that a mandatory field isn't being set? What am I missing?
Hi Tammie - it should work if you set a user-defined default for the Plan field: https://odootricks.tips/user-defined-defaults/