Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
7
sale_tier_validation/models/__init__.py
Executable file
7
sale_tier_validation/models/__init__.py
Executable file
@@ -0,0 +1,7 @@
|
||||
# Copyright 2019 Open Source Integrators
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
from . import sale_order
|
||||
from . import tier_definition
|
||||
13
sale_tier_validation/models/res_company.py
Executable file
13
sale_tier_validation/models/res_company.py
Executable file
@@ -0,0 +1,13 @@
|
||||
# Copyright 2024 Quartile (https://www.quartile.co)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
sale_report_print_block = fields.Boolean(
|
||||
help="Block the printing of the sale order report "
|
||||
"if the order is not validated."
|
||||
)
|
||||
15
sale_tier_validation/models/res_config_settings.py
Executable file
15
sale_tier_validation/models/res_config_settings.py
Executable file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2024 Quartile (https://www.quartile.co)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
sale_report_print_block = fields.Boolean(
|
||||
related="company_id.sale_report_print_block",
|
||||
readonly=False,
|
||||
help="Block the printing of the sale order report "
|
||||
"if the order is not validated.",
|
||||
)
|
||||
22
sale_tier_validation/models/sale_order.py
Executable file
22
sale_tier_validation/models/sale_order.py
Executable file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2019 Open Source Integrators
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_name = "sale.order"
|
||||
_inherit = ["sale.order", "tier.validation"]
|
||||
_state_from = ["draft", "sent"]
|
||||
_state_to = ["sale"]
|
||||
|
||||
_tier_validation_manual_config = False
|
||||
|
||||
def _get_requested_notification_subtype(self):
|
||||
return "sale_tier_validation.sale_order_tier_validation_requested"
|
||||
|
||||
def _get_accepted_notification_subtype(self):
|
||||
return "sale_tier_validation.sale_order_tier_validation_accepted"
|
||||
|
||||
def _get_rejected_notification_subtype(self):
|
||||
return "sale_tier_validation.sale_order_tier_validation_rejected"
|
||||
14
sale_tier_validation/models/tier_definition.py
Executable file
14
sale_tier_validation/models/tier_definition.py
Executable file
@@ -0,0 +1,14 @@
|
||||
# Copyright 2019 Open Source Integrators
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class TierDefinition(models.Model):
|
||||
_inherit = "tier.definition"
|
||||
|
||||
@api.model
|
||||
def _get_tier_validation_model_names(self):
|
||||
res = super()._get_tier_validation_model_names()
|
||||
res.append("sale.order")
|
||||
return res
|
||||
Reference in New Issue
Block a user