[9.0] How to solve this Problem of quantity when a PO is created after the confirmation of SO ?
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.