Files
stock-rma/rma_reason_code/models/reason_code.py
2024-12-19 09:20:13 +01:00

28 lines
757 B
Python

# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from random import randint
from odoo import fields, models
class RMAReasonCode(models.Model):
_name = "rma.reason.code"
_description = "RMA Reason Code"
def _get_default_color(self):
return randint(1, 11)
name = fields.Char("Code", required=True)
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(default=_get_default_color)