Odoo Help


Why is product_id not a required field @ Invoice line?

Atchuthan - Technical Consultant, Sodexis Inc
on 2/6/15, 2:09 AM 1,521 views

Is there any functional reason why product_id is not a required field @ Account Invoice Line?

In case of Sales order and delivery order, product_id is needed to produce procurement and other workflow dependent processes.  

Refer field definition @ github (https://github.com/odoo/odoo/blob/8.0/addons/account/account_invoice.py#L1263)




| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 2/6/15, 3:14 AM

Product_id is used only if you are choosing a product already in database, 
in fact it has on_change method wich copies values from related product (name, price, taxes, accounts etc) 
 to invocie line, but before confirming invocie you are also allowed to manualy update or modify description of invocie line
The description itsef is what you print , and that field is required.

All this is usefull and speeds up the process of invoicing, but, you are not required to have any products in database..
Some cases have realy specific product descriptions - mostly services, where provider (seller) wants to put larger description in one invoice line, and it is case specific, so he decides to write each invoice manualy... in that case, required product_id would be unpractical... 

And finaly... if you want it to be required field.. simply add required="1" in view definition, and there you go.. 


As for sales and procurement workflows... you can use it even if it is not required, and when the workflow reaches invoiceing point,
all product_ids will be applied ( and descriptions created) but you can still add extra line wich for any given reason has no link to any product, only description and price ( example of usage is correction of price, or additional costs wich was not planned in documents before.. etc) 

Hope this explanation makes sense to you:) 


okay.. it makes sense.

Atchuthan - Technical Consultant, Sodexis Inc
on 2/12/15, 7:01 AM

and there is a similar case with Purchase order line. So, how can a purchase order line that do not specify a product purchases something from the supplier. This logic seems absurd or is there any functional requirement for not having required field at Purchase order also.

Atchuthan - Technical Consultant, Sodexis Inc
on 2/12/15, 7:04 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.


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)


Asked: 2/6/15, 2:09 AM
Seen: 1521 times
Last updated: 7/10/15, 3:59 AM