[MIG] rma_reason_code: Migration to 17.0

This commit is contained in:
Meritxell Abellan
2024-12-16 15:59:38 +01:00
parent d1d42fb6d8
commit 1802c71d8a
9 changed files with 40 additions and 22 deletions

View File

@@ -24,9 +24,9 @@ class RMAOrderLine(models.Model):
for rec in self:
codes = self.env["rma.reason.code"]
if rec.type == "customer":
codes = codes.search([("type", "in", ["customer", "both"])])
codes = codes.search([("rma_type", "in", ["customer", "both"])])
else:
codes = codes.search([("type", "in", ["supplier", "both"])])
codes = codes.search([("rma_type", "in", ["supplier", "both"])])
rec.allowed_reason_code_ids = codes
@api.constrains("reason_code_ids", "product_id")