mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] rma: tags
TT29594
This commit is contained in:
committed by
Nikolaus Weingartmair
parent
ef48e86c4b
commit
cce5ad232c
@@ -3,6 +3,7 @@
|
||||
from . import account_move
|
||||
from . import rma
|
||||
from . import rma_operation
|
||||
from . import rma_tag
|
||||
from . import rma_team
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
|
||||
@@ -60,6 +60,7 @@ class Rma(models.Model):
|
||||
index=True,
|
||||
states={"locked": [("readonly", True)], "cancelled": [("readonly", True)]},
|
||||
)
|
||||
tag_ids = fields.Many2many(comodel_name="rma.tag", string="Tags")
|
||||
company_id = fields.Many2one(
|
||||
comodel_name="res.company",
|
||||
default=lambda self: self.env.company,
|
||||
|
||||
21
rma/models/rma_tag.py
Normal file
21
rma/models/rma_tag.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2021 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class RmaTag(models.Model):
|
||||
_description = "RMA Tags"
|
||||
_name = "rma.tag"
|
||||
_order = "name"
|
||||
|
||||
active = fields.Boolean(
|
||||
default=True,
|
||||
help="The active field allows you to hide the category without " "removing it.",
|
||||
)
|
||||
name = fields.Char(string="Tag Name", required=True, translate=True, copy=False,)
|
||||
color = fields.Integer(string="Color Index")
|
||||
rma_ids = fields.Many2many(comodel_name="rma")
|
||||
|
||||
_sql_constraints = [
|
||||
("name_uniq", "unique (name)", "Tag name already exists !"),
|
||||
]
|
||||
Reference in New Issue
Block a user