This question has been flagged
1 Reply
4774 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)

Avatar
Discard
Best Answer

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:) 


 

Avatar
Discard
Author

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.