From 1604d8ebe0b11b22b10051603a2799dadeaa41c9 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Tue, 31 Oct 2023 11:21:42 +0100 Subject: [PATCH] [IMP] loyalty_partner_applicability: Allow to share coupons inside same entity There's a new configuration option in the settings to allow sharing coupons between members of the same trading entity. It has to be in the base module for being shared between all the rest of applications, but each *_applicability module will contain extra bits of code to use it. TT45413 --- .../models/res_config_settings.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 loyalty_partner_applicability/models/res_config_settings.py diff --git a/loyalty_partner_applicability/models/res_config_settings.py b/loyalty_partner_applicability/models/res_config_settings.py new file mode 100644 index 00000000..2aa063af --- /dev/null +++ b/loyalty_partner_applicability/models/res_config_settings.py @@ -0,0 +1,17 @@ +# Copyright 2023 Tecnativa - Pilar Vargas Moreno +# 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" + + # Allows a coupon generated for one partner to be used by any other member + # of your commercial entity. There is a view for this option in the module + # sale_loyalty_partner_applicability + allow_coupon_sharing = fields.Boolean( + string="Allow coupon sharing", + config_parameter="allow_coupon_sharing", + )