diff --git a/base_global_discount/__manifest__.py b/base_global_discount/__manifest__.py index c33b70024..e277717e4 100644 --- a/base_global_discount/__manifest__.py +++ b/base_global_discount/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Base Global Discount", - "version": "13.0.2.0.0", + "version": "14.0.1.0.0", "category": "Base", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/server-backend", diff --git a/base_global_discount/migrations/13.0.1.0.0/post-migration.py b/base_global_discount/migrations/13.0.1.0.0/post-migration.py deleted file mode 100644 index 0d3657bd6..000000000 --- a/base_global_discount/migrations/13.0.1.0.0/post-migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2020 Tecnativa - Ernesto Tejeda -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.logged_query( - env.cr, - """ - INSERT INTO customer_global_discount_rel - (partner_id, global_discount_id) - SELECT - partner_id, - global_discount_id - FROM - global_discount_res_partner_rel - WHERE - discount_scope = 'sale'; - """, - ) - openupgrade.logged_query( - env.cr, - """ - INSERT INTO supplier_global_discount_rel - (partner_id, global_discount_id) - SELECT - partner_id, - field_id - FROM - global_discount_res_partner_rel - WHERE - discount_scope = 'purchase'; - """, - ) diff --git a/base_global_discount/migrations/13.0.1.0.0/pre-migration.py b/base_global_discount/migrations/13.0.1.0.0/pre-migration.py deleted file mode 100644 index 88a9f7f9d..000000000 --- a/base_global_discount/migrations/13.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2020 Tecnativa - Ernesto Tejeda -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - - -def migrate(cr, version): - if not version: - return - cr.execute( - """ - DELETE FROM ir_model_relation - WHERE name = 'global_discount_res_partner_rel'; - """ - ) diff --git a/base_global_discount/models/global_discount.py b/base_global_discount/models/global_discount.py index 60e6b69ea..3ef61c2a5 100644 --- a/base_global_discount/models/global_discount.py +++ b/base_global_discount/models/global_discount.py @@ -30,11 +30,11 @@ class GlobalDiscount(models.Model): return result def _get_global_discount_vals(self, base, **kwargs): - """ Prepare the dict of values to create to obtain the discounted - amount + """Prepare the dict of values to create to obtain the discounted + amount - :param float base: the amount to discount - :return: dict with the discounted amount + :param float base: the amount to discount + :return: dict with the discounted amount """ self.ensure_one() return { diff --git a/base_global_discount/models/res_partner.py b/base_global_discount/models/res_partner.py index 5f504bf2e..e95e29ad4 100644 --- a/base_global_discount/models/res_partner.py +++ b/base_global_discount/models/res_partner.py @@ -25,7 +25,7 @@ class ResPartner(models.Model): # HACK: Looks like UI doesn't behave well with Many2many fields and # negative groups when the same field is shown. In this case, we want to # show the readonly version to any not in the global discount group. - # TODO: Check in v14 if it's fixed + # TODO: Check in future versions if it's fixed customer_global_discount_ids_readonly = fields.Many2many( string="Sale Global Discounts (readonly)", related="customer_global_discount_ids", diff --git a/base_global_discount/readme/CONTRIBUTORS.rst b/base_global_discount/readme/CONTRIBUTORS.rst index 872df73d3..c4649cea3 100644 --- a/base_global_discount/readme/CONTRIBUTORS.rst +++ b/base_global_discount/readme/CONTRIBUTORS.rst @@ -5,3 +5,4 @@ * Carlos Dauden * Rafael Blasco * Ernesto Tejeda +* Omar CastiƱeira diff --git a/base_global_discount/views/res_partner_views.xml b/base_global_discount/views/res_partner_views.xml index 4b64c4928..95d49ee22 100644 --- a/base_global_discount/views/res_partner_views.xml +++ b/base_global_discount/views/res_partner_views.xml @@ -19,6 +19,7 @@ widget="many2many_tags" groups="!base_global_discount.group_global_discount" attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}" + readonly="1" /> diff --git a/setup/base_global_discount/odoo/addons/base_global_discount b/setup/base_global_discount/odoo/addons/base_global_discount new file mode 120000 index 000000000..4635850f7 --- /dev/null +++ b/setup/base_global_discount/odoo/addons/base_global_discount @@ -0,0 +1 @@ +../../../../base_global_discount \ No newline at end of file diff --git a/setup/base_global_discount/setup.py b/setup/base_global_discount/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/base_global_discount/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)