mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 16:12:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
from . import rma_reason
|
||||
from . import rma
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright 2024 Raumschmiede GmbH
|
||||
# Copyright 2024 BCIM
|
||||
# Copyright 2024 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
|
||||
_inherit = "res.company"
|
||||
|
||||
is_rma_reason_required = fields.Boolean(
|
||||
string="Indicates whether specifying an RMA reason is mandatory when creating "
|
||||
"an RMA order."
|
||||
)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Copyright 2024 Raumschmiede GmbH
|
||||
# Copyright 2024 BCIM
|
||||
# Copyright 2024 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
is_rma_reason_required = fields.Boolean(
|
||||
related="company_id.is_rma_reason_required", readonly=False
|
||||
)
|
||||
25
odoo-bringout-oca-rma-rma_reason/rma_reason/models/rma.py
Normal file
25
odoo-bringout-oca-rma-rma_reason/rma_reason/models/rma.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 2024 Raumschmiede GmbH
|
||||
# Copyright 2024 BCIM
|
||||
# Copyright 2024 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class Rma(models.Model):
|
||||
|
||||
_inherit = "rma"
|
||||
|
||||
reason_id = fields.Many2one(comodel_name="rma.reason")
|
||||
is_rma_reason_required = fields.Boolean(related="company_id.is_rma_reason_required")
|
||||
operation_domain = fields.Binary(compute="_compute_operation_domain")
|
||||
|
||||
@api.depends("reason_id")
|
||||
def _compute_operation_domain(self):
|
||||
for rec in self:
|
||||
if rec.reason_id and rec.reason_id.allowed_operation_ids:
|
||||
rec.operation_domain = [
|
||||
("id", "in", rec.reason_id.allowed_operation_ids.ids)
|
||||
]
|
||||
else:
|
||||
rec.operation_domain = []
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Copyright 2024 Raumschmiede GmbH
|
||||
# Copyright 2024 BCIM
|
||||
# Copyright 2024 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class RmaReason(models.Model):
|
||||
|
||||
_name = "rma.reason"
|
||||
_description = "Rma Reason"
|
||||
|
||||
name = fields.Char(required=True, translate=True)
|
||||
description = fields.Text(translate=True)
|
||||
company_id = fields.Many2one(
|
||||
"res.company",
|
||||
required=True,
|
||||
readonly=True,
|
||||
default=lambda self: self.env.company,
|
||||
)
|
||||
allowed_operation_ids = fields.Many2many(
|
||||
comodel_name="rma.operation",
|
||||
string="Operations",
|
||||
help="List of RMA operations that are allowed when this reason is selected.",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue