mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX]move constraint from the rma order to the line
This commit is contained in:
committed by
Carlos Vallés Fuster
parent
a1887b5872
commit
cbeb7e96a4
@@ -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."))
|
||||
|
||||
Reference in New Issue
Block a user