[FIX] purchase_requistion: Duplicate purchase agreement with "Run sch…
…eduler" Steps to reproduce the bug: - Let's consider P a product with routes "buy" and "mto" and with purchase_requistion = 'Propose a call for tenders' - Let's consider a BOM B with P as component - Create a MO for B - Run the scheduler two times Bug: Two purchase agreements have been created for the the same MO. opw:1882280
This commit is contained in:
@@ -313,6 +313,18 @@ class ProductTemplate(models.Model):
|
||||
('tenders', 'Propose a call for tenders')],
|
||||
string='Procurement', default='rfq')
|
||||
|
||||
class StockMove(models.Model):
|
||||
_inherit = "stock.move"
|
||||
|
||||
requistion_line_ids = fields.One2many('purchase.requisition.line', 'move_dest_id')
|
||||
|
||||
class ProcurementGroup(models.Model):
|
||||
_inherit = 'procurement.group'
|
||||
|
||||
@api.model
|
||||
def _get_exceptions_domain(self):
|
||||
return super(ProcurementGroup, self)._get_exceptions_domain() + [('requistion_line_ids', '=', False)]
|
||||
|
||||
|
||||
class ProcurementRule(models.Model):
|
||||
_inherit = 'procurement.rule'
|
||||
|
||||
Reference in New Issue
Block a user