Community mailing list archives

Re: Performance of many2one

Eric Caudal (Odoo Community Association)
- 03/02/2016 18:23:26

I would have a field tax ID at PO level with onchange function to populate the po lines. Product onchange needs to be adapted as well for new created lines.
This way you keep the standard feature/structure and have an easy way to populate your PO.
Last but not least you can think of using the default property for tax field to pre populate your PO tax ID

On Wed, Mar 2, 2016, 23:37 Dominique KON SUN TACK <> wrote:


I would like to have the community opinion.
We have a client who would like to choose the tax from the purchase order, instead of selecting it for each line.
I can see two possibilities:

1) add a tax code on the model purchase.order. Then on the purchase.order.line, replacing the tax by a related field (related='order_id.tax_i'd)

2) we can override the write method of the purchase order line, and ensure that the tax on the line is the same as the tax on the order

Which one would you recommend? Taking into consideration the performance? I understand that adding related fields slow down is Odoo.

Do you have any other suggestion otherwise?


Post to:


Eric  Caudal (from my mobile)