From 508ace56d6b6773bfdc01211a3f5725561cb2673 Mon Sep 17 00:00:00 2001 From: Parthiv Patel Date: Thu, 6 Oct 2022 08:34:33 +0000 Subject: [PATCH] [PATCH] Upstream patch - 06102022 --- addons/barcodes/models/barcodes.py | 41 ++--- .../l10n_ar/data/account.account.template.csv | 15 +- .../account_fiscal_position_template_data.xml | 6 +- addons/l10n_es/data/account_tax_data.xml | 151 ++++++++++++++++++ .../data/account_tax_template_data.xml | 2 + .../src/components/message/message.scss | 6 + addons/point_of_sale/models/pos_config.py | 2 +- .../views/customer_facing_display.xml | 2 +- addons/test_xlsx_export/tests/test_export.py | 18 +++ addons/web/controllers/main.py | 7 +- .../static/src/js/fields/relational_fields.js | 2 - addons/web/static/src/xml/base.xml | 2 +- .../tests/fields/relational_fields_tests.js | 5 +- .../static/src/js/backend/field_html.js | 3 +- .../static/tests/field_html_tests.js | 50 +++++- 15 files changed, 255 insertions(+), 57 deletions(-) diff --git a/addons/barcodes/models/barcodes.py b/addons/barcodes/models/barcodes.py index e4a069a031..72580cdb22 100644 --- a/addons/barcodes/models/barcodes.py +++ b/addons/barcodes/models/barcodes.py @@ -25,48 +25,27 @@ class BarcodeNomenclature(models.Model): # returns the checksum of the ean13, or -1 if the ean has not the correct length, ean must be a string def ean_checksum(self, ean): - code = list(ean) - if len(code) != 13: + if len(ean) != 13: return -1 - - oddsum = evensum = total = 0 - code = code[:-1] # Remove checksum - for i in range(len(code)): - if i % 2 == 0: - evensum += int(code[i]) - else: - oddsum += int(code[i]) - total = oddsum * 3 + evensum - return int((10 - total % 10) % 10) + return self.env['ir.actions.report'].get_barcode_check_digit(ean) # returns the checksum of the ean8, or -1 if the ean has not the correct length, ean must be a string def ean8_checksum(self,ean): - code = list(ean) - if len(code) != 8: + if len(ean) != 8: return -1 - - sum1 = int(ean[1]) + int(ean[3]) + int(ean[5]) - sum2 = int(ean[0]) + int(ean[2]) + int(ean[4]) + int(ean[6]) - total = sum1 + 3 * sum2 - return int((10 - total % 10) % 10) + return self.env['ir.actions.report'].get_barcode_check_digit(ean) # returns true if the barcode is a valid EAN barcode def check_ean(self, ean): - return re.match("^\d+$", ean) and self.ean_checksum(ean) == int(ean[-1]) + if len(ean) == 13: + return self.env['ir.actions.report'].check_barcode_encoding(ean, 'ean13') + elif len(ean) == 8: + return self.env['ir.actions.report'].check_barcode_encoding(ean, 'ean8') + return False # returns true if the barcode string is encoded with the provided encoding. def check_encoding(self, barcode, encoding): - if encoding == 'ean13': - return len(barcode) == 13 and re.match("^\d+$", barcode) and self.ean_checksum(barcode) == int(barcode[-1]) - elif encoding == 'ean8': - return len(barcode) == 8 and re.match("^\d+$", barcode) and self.ean8_checksum(barcode) == int(barcode[-1]) - elif encoding == 'upca': - return len(barcode) == 12 and re.match("^\d+$", barcode) and self.ean_checksum("0"+barcode) == int(barcode[-1]) - elif encoding == 'any': - return True - else: - return False - + return self.env['ir.actions.report'].check_barcode_encoding(barcode, encoding) # Returns a valid zero padded ean13 from an ean prefix. the ean prefix must be a string. def sanitize_ean(self, ean): diff --git a/addons/l10n_ar/data/account.account.template.csv b/addons/l10n_ar/data/account.account.template.csv index daa614512b..3527d829e9 100644 --- a/addons/l10n_ar/data/account.account.template.csv +++ b/addons/l10n_ar/data/account.account.template.csv @@ -99,15 +99,15 @@ l10n_ar.base_productos_terminados,l10n_ar.l10nar_base_chart_template,1.1.6.01.03 l10n_ar.base_mercaderia_reventa,l10n_ar.l10nar_base_chart_template,1.1.6.01.040,account.data_account_type_current_assets,Mercaderia de reventa,False l10n_ar.base_anticipo_proveedores,l10n_ar.l10nar_base_chart_template,1.1.6.01.050,account.data_account_type_current_assets,Anticipo a Proveedores,False l10n_ar.base_instalaciones,l10n_ar.l10nar_base_chart_template,1.2.1.01.010,account.data_account_type_fixed_assets,Instalaciones,False -l10n_ar.base_amortizacion_acumulada_instalaciones,l10n_ar.l10nar_base_chart_template,1.2.1.01.020,account.data_account_type_depreciation,Amortización acumulada instalaciones,False +l10n_ar.base_amortizacion_acumulada_instalaciones,l10n_ar.l10nar_base_chart_template,1.2.1.01.020,account.data_account_type_fixed_assets,Amortización acumulada instalaciones,False l10n_ar.base_maq_y_equipos,l10n_ar.l10nar_base_chart_template,1.2.1.02.010,account.data_account_type_fixed_assets,Maquinarias y equipos,False -l10n_ar.base_amortizacion_acumulada_maq_y_equipos,l10n_ar.l10nar_base_chart_template,1.2.1.02.020,account.data_account_type_depreciation,Amortización acumulada maquinarias y equipos,False +l10n_ar.base_amortizacion_acumulada_maq_y_equipos,l10n_ar.l10nar_base_chart_template,1.2.1.02.020,account.data_account_type_fixed_assets,Amortización acumulada maquinarias y equipos,False l10n_ar.base_muebles_y_utiles,l10n_ar.l10nar_base_chart_template,1.2.1.03.010,account.data_account_type_fixed_assets,Muebles y útiles,False -l10n_ar.base_amortizacion_acumulada_muebles_utiles,l10n_ar.l10nar_base_chart_template,1.2.1.03.020,account.data_account_type_depreciation,Amortización acumulada muebles y útiles,False +l10n_ar.base_amortizacion_acumulada_muebles_utiles,l10n_ar.l10nar_base_chart_template,1.2.1.03.020,account.data_account_type_fixed_assets,Amortización acumulada muebles y útiles,False l10n_ar.base_rodados,l10n_ar.l10nar_base_chart_template,1.2.1.04.010,account.data_account_type_fixed_assets,Rodados,False -l10n_ar.base_amortizacion_acumulada_rodados,l10n_ar.l10nar_base_chart_template,1.2.1.04.020,account.data_account_type_depreciation,Amortización acumulada rodados,False +l10n_ar.base_amortizacion_acumulada_rodados,l10n_ar.l10nar_base_chart_template,1.2.1.04.020,account.data_account_type_fixed_assets,Amortización acumulada rodados,False l10n_ar.base_derechos_de_marca,l10n_ar.l10nar_base_chart_template,1.2.2.01.010,account.data_account_type_fixed_assets,Derechos de marca,False -l10n_ar.base_amortizacion_acumulada_derechos_de_marca,l10n_ar.l10nar_base_chart_template,1.2.2.01.020,account.data_account_type_depreciation,Amortización acumulada Derechos de marca,False +l10n_ar.base_amortizacion_acumulada_derechos_de_marca,l10n_ar.l10nar_base_chart_template,1.2.2.01.020,account.data_account_type_fixed_assets,Amortización acumulada Derechos de marca,False l10n_ar.base_proveedores,l10n_ar.l10nar_base_chart_template,2.1.1.01.010,account.data_account_type_payable,Proveedores,True l10n_ar.base_cheques_diferidos,l10n_ar.l10nar_base_chart_template,2.1.1.01.020,account.data_account_type_current_liabilities,Cheques diferidos a pagar,True l10n_ar.base_cheques_rechazados,l10n_ar.l10nar_base_chart_template,2.1.1.01.030,account.data_account_type_current_liabilities,Cheques Rechazados,False @@ -288,4 +288,9 @@ l10n_ar.base_intereses_por_venta_de_valores,l10n_ar.l10nar_base_chart_template,5 l10n_ar.base_intereses_fiscales,l10n_ar.l10nar_base_chart_template,5.6.1.01.050,account.data_account_type_expenses,Intereses fiscales,False l10n_ar.base_gastos_bancarios,l10n_ar.l10nar_base_chart_template,5.6.1.01.060,account.data_account_type_expenses,Gastos Bancarios,False l10n_ar.base_r_e_c_p_a_m,l10n_ar.l10nar_base_chart_template,5.6.1.01.070,account.data_account_type_expenses,R.E.C.P.A.M.,False +l10n_ar.base_amortizacion_instalaciones,l10n_ar.l10nar_base_chart_template,5.7.1.01.010,account.data_account_type_depreciation,Amortización instalaciones,False +l10n_ar.base_amortizacion_maq_y_equipos,l10n_ar.l10nar_base_chart_template,5.7.1.01.020,account.data_account_type_depreciation,Amortización maquinarias y equipos,False +l10n_ar.base_amortizacion_muebles_utiles,l10n_ar.l10nar_base_chart_template,5.7.1.01.030,account.data_account_type_depreciation,Amortización muebles y útiles,False +l10n_ar.base_amortizacion_rodados,l10n_ar.l10nar_base_chart_template,5.7.1.01.040,account.data_account_type_depreciation,Amortización rodados,False +l10n_ar.base_amortizacion_derechos_de_marca,l10n_ar.l10nar_base_chart_template,5.7.1.01.050,account.data_account_type_depreciation,Amortización Derechos de marca,False l10n_ar.base_contrapartida_auxiliar,l10n_ar.l10nar_base_chart_template,6.0.0.00.010,account.data_account_type_current_assets,Contrapartida Auxiliar,False diff --git a/addons/l10n_es/data/account_fiscal_position_template_data.xml b/addons/l10n_es/data/account_fiscal_position_template_data.xml index c971cc630f..9db4782e24 100644 --- a/addons/l10n_es/data/account_fiscal_position_template_data.xml +++ b/addons/l10n_es/data/account_fiscal_position_template_data.xml @@ -3574,7 +3574,7 @@ - + @@ -3589,7 +3589,7 @@ - + @@ -3604,7 +3604,7 @@ - + diff --git a/addons/l10n_es/data/account_tax_data.xml b/addons/l10n_es/data/account_tax_data.xml index 57b873cb3e..071f2bda2b 100644 --- a/addons/l10n_es/data/account_tax_data.xml +++ b/addons/l10n_es/data/account_tax_data.xml @@ -9,6 +9,7 @@ © 2015 Vicent Cubells © 2013-2020 Pedro M. Baeza © 2020 Harald Panten - Sygel Technology + © 2022 Omar Castiñeira - Comunitea License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> @@ -3943,6 +3944,156 @@ }), ]"/> + + IVA 4% ISP (bienes de inversión) + purchase + percent + + + + + + + + IVA 10% ISP (bienes de inversión) + purchase + percent + + + + + + + + IVA 21% ISP (bienes de inversión) + purchase + percent + + + + + + purchase diff --git a/addons/l10n_nz/data/account_tax_template_data.xml b/addons/l10n_nz/data/account_tax_template_data.xml index b23dcb2374..1f616c805a 100644 --- a/addons/l10n_nz/data/account_tax_template_data.xml +++ b/addons/l10n_nz/data/account_tax_template_data.xml @@ -286,6 +286,7 @@ 'factor_percent': 100, 'repartition_type': 'tax', 'account_id': ref('nz_21330'), + 'plus_report_line_ids': [ref('tax_report_box11')], }), ]"/> diff --git a/addons/mail/static/src/components/message/message.scss b/addons/mail/static/src/components/message/message.scss index 16d9c7902a..a6383f99c2 100644 --- a/addons/mail/static/src/components/message/message.scss +++ b/addons/mail/static/src/components/message/message.scss @@ -54,6 +54,12 @@ // may impact the bullet point (at least it does on Safari). max-width: 100%; overflow-x: auto; + + // overflow: auto can break rendering of next element of a frequent broken Outlook 365 + // warning table. If detected, we prevent the issue by removing flotation. + &table[align="left"][width="100%"] { + float: none; + } } img { diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 672cdbff97..7324e6d911 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -99,7 +99,7 @@ class PosConfig(models.Model): def _compute_customer_html(self): for config in self: - config.customer_facing_display_html = self.env['ir.qweb']._render('point_of_sale.customer_facing_display_html') + config.customer_facing_display_html = self.env['ir.qweb']._render('point_of_sale.customer_facing_display_html', {'company': self.company_id}) name = fields.Char(string='Point of Sale', index=True, required=True, help="An internal identification of the point of sale.") is_installed_account_accountant = fields.Boolean(string="Is the Full Accounting Installed", diff --git a/addons/point_of_sale/views/customer_facing_display.xml b/addons/point_of_sale/views/customer_facing_display.xml index d9372f9662..21a70903e6 100644 --- a/addons/point_of_sale/views/customer_facing_display.xml +++ b/addons/point_of_sale/views/customer_facing_display.xml @@ -42,7 +42,7 @@
-