mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma_reason_code: Migration to 17.0
This commit is contained in:
@@ -13,14 +13,15 @@ class RMAReasonCode(models.Model):
|
||||
return randint(1, 11)
|
||||
|
||||
name = fields.Char("Code", required=True)
|
||||
description = fields.Text("Description")
|
||||
type = fields.Selection(
|
||||
description = fields.Text()
|
||||
rma_type = fields.Selection(
|
||||
[
|
||||
("customer", "Customer RMA"),
|
||||
("supplier", "Supplier RTV"),
|
||||
("both", "Both Customer and Supplier"),
|
||||
],
|
||||
default="both",
|
||||
string="RMA Type",
|
||||
required=True,
|
||||
)
|
||||
color = fields.Integer("Color", default=_get_default_color)
|
||||
color = fields.Integer(default=_get_default_color)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user