Default analytic account on PO

To discuss technical and functional points.
Post Reply
admin
Posts: 2062
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Default analytic account on PO

Post 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 3839 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests