Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,4 @@
from . import rma_reason
from . import rma
from . import res_company
from . import res_config_settings

View file

@ -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."
)

View file

@ -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
)

View 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 = []

View file

@ -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.",
)