Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hello, I'm working on an addon for purchase discounts, because there is no addon for v8 wich makes it. I have got discounts working on providers pricelist, and on purchase orders. After a few days, i'm mired trying to pass discounts from purchase orders to purchase invoices. On another question I made on this forum, somebody tells me to use _get_invoice_line_vals function wich belongs to stock_account/stock.py, but I can't find a way to pass discount field to invoices.
Diving on the code, I see unit_price is obtained by _get_price_unit_invoice function of stock_move class. Looking this function, I see price_unit is obtained from move_line, and now I'm a little lost. I'm not sure if the best way is to get discount like price_unit is obtained, adding a field for discount to move_line, and if this is the right way, I don't find the function wich passes values from purchase orders to move_line. In other hand, I think sale orders don't uses this way to pass discount from sale orders to sale invoices, but I don't know how odoo makes it, and this could put me on the right path.
Any help would be apreciated. Thanks in advice.
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
|Asked: 12/3/14, 7:06 AM|
|Seen: 1021 times|
|Last updated: 3/16/15, 8:10 AM|