Page 1 of 1

Default analytic account on PO

Posted: Sun Dec 10, 2017 4:07 am
by admin
Q: On PO lines need to select analytical account and tag for each line. Is there a way to assign these values once and will be defaulted in all lines?

A: 1. Enable developer mode and on PO create two new fields as shown on the screen below,
analytic odoo.JPG
analytic odoo.JPG (72.36 KiB) Viewed 4154 times
2. In the xml update the context as below,

<field name="order_line" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}" context="{'default_account_analytic_id': x_analytic_account1, 'default_analytic_tag_ids': x_analytic_tags}">

3. Now when you will add line(s) it will default from header.