Skip to Content
Menu
This question has been flagged
5 Replies
3572 Views

In my company Invoices are created after the delivery order 

and I added new field to the delivery order move line called country of origin 

I would like for the value of this field to move automatically to a field of the same name created in invoice order line when I  create the invoice

thnx  

Avatar
Discard
Best Answer

Hi ! Did you build your custom module for this ? Can you please share ?

Avatar
Discard
Best Answer

Simplest wasy would be to add database trigger to copy value to invoice.

To do it in "Odoo way" you need to modify "write" and "create" method of delivery order to invoke "write" method for invoice.

 

Marek Mosiewicz

http://consultantodoo.com

Avatar
Discard
Author

thank you for your answer , the 'write' and 'create' methods are in stock.py ?? and is it possible to override them in a custom module ?

You should actually override them in custom module. The write and create methods are defined for every single model. For your case I think inheriting _invoice_hook and/or _invoice_line_hook of stock.picking model makes more sense.

Best Answer

Yes, we use the same workflow. I added a field to the product, country of origin. Then just added that to the invoice line. We need to show for exporting product to other countries.

Avatar
Discard