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.
Hi, I inherit the function "make_po" in order that after the confirmation of a SO, a PO is created.
It works but the problem is that if I put 1 article X in my SO, I'll have 3 articles X in my PO
I did tests with prints and the function "make_po" is executed 3 times but I don't know why.
This is my class:
_inherit = 'procurement.order'
res = super(procurement_order,self).make_po()
so_name = self.origin[:5]
sale_order=self.env['sale.order'].search([('name', '=', so_name)])
analytic_account_id = sale_order.project_id.id
po_line = self.env['purchase.order.line']
idPOLine = po_line.search([('id', '=', self.purchase_line_id.id)])
In advance, thanks.
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: 3/29/16, 4:04 AM|
|Seen: 635 times|
|Last updated: 3/30/16, 7:02 AM|