From 84ee04817c65e481f9d4fa6bf6cccfa4436f838d Mon Sep 17 00:00:00 2001 From: Parthiv Patel Date: Sat, 6 Aug 2022 08:34:21 +0000 Subject: [PATCH] [PATCH] Upstream patch - 06082022 --- addons/account/models/account_move.py | 2 +- .../tests/test_sepa_qr.py | 15 ++++- addons/l10n_be/data/account_data.xml | 34 +++++------ .../l10n_it_edi/data/account_invoice_demo.xml | 4 ++ .../l10n_it_edi/data/invoice_it_template.xml | 20 ++++-- .../l10n_it_edi/models/account_edi_format.py | 18 +++--- addons/l10n_it_edi/models/account_invoice.py | 10 ++- addons/l10n_it_edi/models/res_partner.py | 6 +- addons/l10n_it_edi/tests/__init__.py | 1 + addons/l10n_it_edi/tests/test_res_partner.py | 61 +++++++++++++++++++ .../tests/test_edi_reverse_charge_xml.py | 46 +++++++++++--- .../static/src/js/mass_mailing_widget.js | 2 +- addons/mrp/views/mrp_production_views.xml | 2 +- addons/point_of_sale/static/src/js/models.js | 10 +++ .../xml/Screens/ProductScreen/Orderline.xml | 4 +- addons/purchase_stock/models/purchase.py | 3 +- addons/sale/models/sale.py | 1 + addons/sale/tests/test_sale_order.py | 14 +++++ .../stock_dropshipping/models/res_company.py | 2 + .../static/src/js/components/datepicker.js | 3 +- .../web/static/src/js/fields/field_utils.js | 22 ++++--- .../static/tests/fields/field_utils_tests.js | 14 ++++- .../static/src/js/editor/snippets.options.js | 11 +++- addons/website/static/src/scss/website.scss | 10 ++- 24 files changed, 251 insertions(+), 64 deletions(-) create mode 100644 addons/l10n_it_edi/tests/test_res_partner.py diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c8d98b58f8..c41a8fcb9f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -294,7 +294,7 @@ class AccountMove(models.Model): default=_get_default_invoice_incoterm, help='International Commercial Terms are a series of predefined commercial terms used in international transactions.') display_qr_code = fields.Boolean(string="Display QR-code", related='company_id.qr_code') - qr_code_method = fields.Selection(string="Payment QR-code", + qr_code_method = fields.Selection(string="Payment QR-code", copy=False, selection=lambda self: self.env['res.partner.bank'].get_available_qr_methods_in_sequence(), help="Type of QR-code to be generated for the payment of this invoice, when printing it. If left blank, the first available and usable method will be used.") diff --git a/addons/account_qr_code_sepa/tests/test_sepa_qr.py b/addons/account_qr_code_sepa/tests/test_sepa_qr.py index 775414ab46..70c820c74c 100644 --- a/addons/account_qr_code_sepa/tests/test_sepa_qr.py +++ b/addons/account_qr_code_sepa/tests/test_sepa_qr.py @@ -3,7 +3,7 @@ from flectra.exceptions import UserError from flectra.addons.account.tests.common import AccountTestInvoicingCommon from flectra.tests import tagged - +from flectra import fields @tagged('post_install', '-at_install') class TestSEPAQRCode(AccountTestInvoicingCommon): @@ -62,3 +62,16 @@ class TestSEPAQRCode(AccountTestInvoicingCommon): """ self.sepa_qr_invoice.generate_qr_code() self.assertEqual(self.sepa_qr_invoice.qr_code_method, 'sct_qr', "SEPA QR-code generator should have been chosen for this invoice.") + + def test_out_invoice_create_refund_qr_code(self): + self.sepa_qr_invoice.generate_qr_code() + self.sepa_qr_invoice.action_post() + move_reversal = self.env['account.move.reversal'].with_context(active_model="account.move", active_ids=self.sepa_qr_invoice.ids).create({ + 'date': fields.Date.from_string('2019-02-01'), + 'reason': 'no reason', + 'refund_method': 'refund', + }) + reversal = move_reversal.reverse_moves() + reverse_move = self.env['account.move'].browse(reversal['res_id']) + + self.assertFalse(reverse_move.qr_code_method, "qr_code_method for credit note should be None") diff --git a/addons/l10n_be/data/account_data.xml b/addons/l10n_be/data/account_data.xml index 0ac6aaf6a9..12a8df1e68 100644 --- a/addons/l10n_be/data/account_data.xml +++ b/addons/l10n_be/data/account_data.xml @@ -1,24 +1,24 @@ - - - - - TVA 21% - + - - TVA 12% - + + + TVA 21% + - - TVA 6% - + + TVA 12% + - - TVA 0% - + + TVA 6% + - - \ No newline at end of file + + TVA 0% + + + + diff --git a/addons/l10n_it_edi/data/account_invoice_demo.xml b/addons/l10n_it_edi/data/account_invoice_demo.xml index e7dfcbab7b..f1ec3dbef2 100644 --- a/addons/l10n_it_edi/data/account_invoice_demo.xml +++ b/addons/l10n_it_edi/data/account_invoice_demo.xml @@ -12,6 +12,10 @@ 12345 + + 0803HR0 + + Palazzo dell'Arte IT00000010215 diff --git a/addons/l10n_it_edi/data/invoice_it_template.xml b/addons/l10n_it_edi/data/invoice_it_template.xml index 9c25e86b72..b64d35ed61 100644 --- a/addons/l10n_it_edi/data/invoice_it_template.xml +++ b/addons/l10n_it_edi/data/invoice_it_template.xml @@ -3,6 +3,12 @@