[FIX] Avoid singleton error ina case of many Agreement for same SO

This commit is contained in:
Daniel Reis
2020-02-20 17:10:38 +00:00
committed by GitHub
parent 438961a578
commit 70d46fe8ed

View File

@@ -11,8 +11,10 @@ class SaleOrder(models.Model):
def _action_confirm(self):
res = super(SaleOrder, self)._action_confirm()
for order in self:
agreement_id = self.env['agreement'].\
agreement_ids = self.env['agreement'].\
search([('sale_id', '=', order.id)])
agreement_id.fsm_location_id = order.partner_id.\
service_location_id
service_location_id = order.partner_id.service_location_id
agreement_ids.write({
'fsm_location_id': order.partner_id.service_location_id,
})
return res