[FIX]move constraint from the rma order to the line

This commit is contained in:
ahenriquez
2019-10-29 16:36:59 +01:00
committed by Carlos Vallés Fuster
parent a1887b5872
commit cbeb7e96a4
2 changed files with 6 additions and 10 deletions

View File

@@ -622,3 +622,9 @@ class RmaOrderLine(models.Model):
result['views'] = [(res and res.id or False, 'form')]
result['res_id'] = rma_lines[0]
return result
@api.constrains("partner_id", "rma_id")
def _check_partner_id(self):
if self.rma_id and self.partner_id != self.rma_id.partner_id:
raise UserError(_(
"Group partner and RMA's partner must be the same."))