Odoo Help

0

adding values to invoice automatically

By
Shokri Alnajjar
on 8/27/14, 5:38 AM 1,050 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  

0
Sayed Anisul Hoque
On 9/14/15, 1:27 AM

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

0
E.R. Spada II
On 8/29/14, 2:54 AM

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.

0
Marek Mosiewicz
On 8/27/14, 5:43 AM

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

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 ?

Shokri Alnajjar
on 8/27/14, 6:08 AM

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.

Ivan
on 8/27/14, 6:48 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 8/27/14, 5:38 AM
Seen: 1050 times
Last updated: 9/14/15, 1:27 AM