Odoo Help

Welcome!

This community 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.

0

adding values to invoice automatically

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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