From 48b3893b84cbd51f880548b38d036db5ebc1e256 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Mon, 5 Aug 2019 20:24:02 +0000 Subject: [PATCH 01/70] [FIX] pos_mercury: Fix duplicate xml id Follow up on https://github.com/odoo/odoo/commit/63f052a40072e3a5487a8fe61c29f29d48807334#r34578119 Due to this https://github.com/odoo/odoo/blob/12.0/addons/pos_mercury/views/pos_config_setting_views.xml#L3 was being replaced by this view (See manifest for info) closes odoo/odoo#35471 Signed-off-by: Nicolas Martinelli (nim) --- addons/pos_mercury/views/pos_config_views.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/pos_mercury/views/pos_config_views.xml b/addons/pos_mercury/views/pos_config_views.xml index 8da1d16bd8a..63aa77de208 100644 --- a/addons/pos_mercury/views/pos_config_views.xml +++ b/addons/pos_mercury/views/pos_config_views.xml @@ -1,6 +1,11 @@ - + + pos.config.form.view.inherit.mercury pos.config From 066722b2f6e8f0d0e11ea0fdfc41f7d6b575e37d Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Thu, 11 Jul 2019 11:45:19 +0000 Subject: [PATCH 02/70] [FIX] base_vat: validation for Chile and Colombia Add validation using stdnum library since vatnumber is deprecated. closes odoo/odoo#35433 Signed-off-by: Nicolas Martinelli (nim) --- addons/base_vat/models/res_partner.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/base_vat/models/res_partner.py b/addons/base_vat/models/res_partner.py index 432f7f04c42..6d6951d7ac4 100644 --- a/addons/base_vat/models/res_partner.py +++ b/addons/base_vat/models/res_partner.py @@ -14,6 +14,13 @@ except ImportError: "Install it to support more countries, for example with `easy_install vatnumber`.") vatnumber = None +# Although stdnum is a dependency of vatnumber, the import of the latter is surrounded by a try/except +# if it is not installed. Therefore, we cannot be sure stdnum is installed in all cases. +try: + import stdnum +except ImportError: + stdnum = None + from odoo import api, models, _ from odoo.tools.misc import ustr from odoo.exceptions import ValidationError @@ -29,6 +36,8 @@ _ref_vat = { 'be': 'BE0477472701', 'bg': 'BG1234567892', 'ch': 'CHE-123.456.788 TVA or CH TVA 123456', # Swiss by Yannick Vaucher @ Camptocamp + 'cl': 'CL76086428-5', + 'co': 'CO213123432-1 or CO213.123.432-1', 'cy': 'CY12345678F', 'cz': 'CZ12345679', 'de': 'DE123456788', @@ -363,3 +372,9 @@ class ResPartner(models.Model): return stdnum.al.vat.is_valid(vat) except ImportError: return True + + def check_vat_cl(self, vat): + return stdnum.util.get_cc_module('cl', 'vat').is_valid(vat) if stdnum else True + + def check_vat_co(self, vat): + return stdnum.util.get_cc_module('co', 'vat').is_valid(vat) if stdnum else True From dd0e3fee0216014da6a56f9f1fe3004a67a6d9ab Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 7 Aug 2019 05:59:45 +0000 Subject: [PATCH 03/70] [FIX] stock: do not raise error Although this makes sense to warn the user, a `UserError` stops the execution of onchanges but do not prevent saving incorrect settings. A non-blocking warning would be another solution, but one issue remains: a pop-up is raised when the user opens the settings, even if they are unrelated (e.g.: open Website settings, an error message implying Inventory appears). This reverts commit c7beb9994f2b3aecef3f03aa81e0240e0d3eaf71. closes odoo/odoo#35511 Signed-off-by: Nicolas Martinelli (nim) --- addons/stock/i18n/stock.pot | 7 ------- addons/stock/models/res_config_settings.py | 10 +--------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 09ce03e4859..5faad4e2547 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6495,13 +6495,6 @@ msgstr "" msgid "You need to supply a Lot/Serial number for product %s." msgstr "" -#. module: stock -#: code:addons/stock/models/res_config_settings.py:70 -#, python-format -msgid "You should not remove the 'lots and serial numbers' option while the following products are still tracked by lot or serial number:\n" -" %s" -msgstr "" - #. module: stock #: code:addons/stock/models/product.py:394 #: code:addons/stock/models/product.py:538 diff --git a/addons/stock/models/res_config_settings.py b/addons/stock/models/res_config_settings.py index b39b1a6beaa..ebf7d339d39 100644 --- a/addons/stock/models/res_config_settings.py +++ b/addons/stock/models/res_config_settings.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models, _ -from odoo.exceptions import UserError +from odoo import api, fields, models class ResConfigSettings(models.TransientModel): @@ -65,13 +64,6 @@ class ResConfigSettings(models.TransientModel): def _onchange_group_stock_production_lot(self): if not self.group_stock_production_lot: self.group_lot_on_delivery_slip = False - tracked_products = self.env['product.template'].search([('tracking', 'in', ['lot', 'serial']),]) - if not self.group_stock_production_lot and tracked_products: - names = ", ".join(tracked_products.mapped('display_name') if len(tracked_products) <= 10 - else tracked_products[:10].mapped('display_name') + ["..."]) - raise UserError(_("You should not remove the 'lots and serial numbers' " - "option while the following products are still tracked by lot " - "or serial number:\n %s") % names) @api.onchange('group_stock_adv_location') def onchange_adv_location(self): From 461effb9fc52d0d7a0e7ae30aedbc049b0fcde7a Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Wed, 7 Aug 2019 06:41:16 +0000 Subject: [PATCH 04/70] [FIX] l10n_it_edi: checking for Codice Ficale/VAT on invoice for non Italians Before this commit, when validating an e-invoice there are blocking errors if VAT or Codice fiscale fields are empty for non Italians buyers. After this commit, if VAT or Codice Fiscale fields are empty for non Italians buyers, the system will allow invoice validation. opw-2045244 closes odoo/odoo#35515 Signed-off-by: Nicolas Martinelli (nim) --- addons/l10n_it_edi/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 1ba9b6ec213..54ff7b11e70 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -110,7 +110,7 @@ class AccountInvoice(models.Model): raise UserError(_("%s must have a country.") % (seller.display_name)) # <1.4.1> - if not buyer.vat and not buyer.l10n_it_codice_fiscale: + if not buyer.vat and not buyer.l10n_it_codice_fiscale and buyer.country_id.code != 'IT': raise UserError(_("The buyer, %s, or his company must have either a VAT number either a tax code (Codice Fiscale).") % (buyer.display_name)) # <1.4.2> From cb70c8078128aed370d7566971e2c4979cb4708d Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Wed, 7 Aug 2019 07:15:48 +0000 Subject: [PATCH 05/70] [FIX] pos_mercury: save button Before this fix the save button in settings was not replaced when pos_mercury is installed. Caused by 2 views with the same id. closes odoo/odoo#35517 Signed-off-by: pimodoo --- addons/pos_mercury/views/pos_config_setting_views.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/pos_mercury/views/pos_config_setting_views.xml b/addons/pos_mercury/views/pos_config_setting_views.xml index 99f0f9d786f..cc92de56eea 100644 --- a/addons/pos_mercury/views/pos_config_setting_views.xml +++ b/addons/pos_mercury/views/pos_config_setting_views.xml @@ -1,7 +1,7 @@ - - pos.config.form.inherit.mercury + + res.config.form.inherit.mercury res.config.settings From b972cc64a68bcadf18344f9e891f74cb3accb509 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Mon, 5 Aug 2019 20:00:24 +0000 Subject: [PATCH 06/70] [FIX] account: use correct module label Introduced at db4f62bd115e98c4ff2 This was causing issue with upgrade_boolean widget, cf odoo/odoo#20030 closes odoo/odoo#35469 Signed-off-by: Martin Trigaux (mat) --- addons/account/views/res_config_settings_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/views/res_config_settings_views.xml b/addons/account/views/res_config_settings_views.xml index f255512bd74..a6d3b3edd6a 100644 --- a/addons/account/views/res_config_settings_views.xml +++ b/addons/account/views/res_config_settings_views.xml @@ -244,7 +244,7 @@
-