1. Create a new field on the Purchase Order model to store the Analytic Account Default:
2. Add this new field to the Purchase Order view:
(You would create your own view that inherits the standard view and add the new field at the position you like):
<field name="x_account_analytic_account"/>
3. Set the context for the order_line field so that it picks up the value selected in the new field:
context="{'default_account_analytic_id': x_account_analytic_account,}"
4. As soon as you Add an Item on the Purchase Order, the account_analytic_id field on the Purchase Order Line will be populated:
You can do the same for the analytic_tag_ids field.
Hello,
It was working perfectly in V12 but does not seem to work anymore in V13?
Any feedback?
Thanks
I just tried this at v13. It still works. Please retrace your steps and if you are having problems, create a NEW question that links to this one, sharing your steps with more detail than "does not seem to work" as it is very challenging to know what the problem is: Does the field show on the screen? Can you select an Account? Does the Analytic Account field show on the line? Does a value get populated? Does the incorrect value get populated? Is there any error? etc.
With the same setup ... the field analytic account on the order line does not populate In V13 even if it was well the case in the V12. Same DB just migrated in V13
It works in V13 if we do the update directly in the form view of the PO... If I try to do the update the context of the order line via Studio like in V12 it does not work however... Whatever it still works via the form view update.