From f6542d28cc72cfaa201d937a03d23dd9ab64895b Mon Sep 17 00:00:00 2001 From: Flectra Community Bot Date: Wed, 26 May 2021 13:44:26 +0200 Subject: [PATCH] Automatic Update form OCA2FC Migrator --- README.md | 2 +- account_banking_pain_base/__manifest__.py | 2 +- .../i18n/account_banking_pain_base.pot | 6 ++-- account_banking_pain_base/i18n/de.po | 6 ++-- account_banking_pain_base/i18n/es.po | 6 ++-- account_banking_pain_base/i18n/fr.po | 6 ++-- account_banking_pain_base/i18n/hr.po | 6 ++-- account_banking_pain_base/i18n/it.po | 6 ++-- account_banking_pain_base/i18n/nb_NO.po | 6 ++-- account_banking_pain_base/i18n/nl.po | 6 ++-- account_banking_pain_base/i18n/pt_BR.po | 6 ++-- account_banking_pain_base/i18n/sl.po | 6 ++-- .../models/account_payment_order.py | 28 +++++++++++++++++++ 13 files changed, 60 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 7d2e9f3..3c3134e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ addon | version | summary [account_banking_sepa_direct_debit](account_banking_sepa_direct_debit/) | 2.0.1.0.4| Create SEPA files for Direct Debit [account_banking_sepa_credit_transfer](account_banking_sepa_credit_transfer/) | 2.0.1.0.0| Create SEPA XML files for Credit Transfers [account_banking_mandate_sale](account_banking_mandate_sale/) | 2.0.1.0.0| Adds mandates on sale orders -[account_banking_pain_base](account_banking_pain_base/) | 2.0.1.0.2| Base module for PAIN file generation +[account_banking_pain_base](account_banking_pain_base/) | 2.0.1.0.3| Base module for PAIN file generation [account_payment_sale](account_payment_sale/) | 2.0.1.0.2| Adds payment mode on sale orders [account_banking_mandate](account_banking_mandate/) | 2.0.2.0.1| Banking mandates diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index 4157553..ae4af62 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -6,7 +6,7 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '2.0.1.0.2', + 'version': '2.0.1.0.3', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot index 61005e1..b742ee2 100644 --- a/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -207,7 +207,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -231,7 +231,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -574,7 +574,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/de.po b/account_banking_pain_base/i18n/de.po index d1b210a..7fd8778 100644 --- a/account_banking_pain_base/i18n/de.po +++ b/account_banking_pain_base/i18n/de.po @@ -218,7 +218,7 @@ msgid "Credit Card Payment " msgstr "Kreditkarten Zahlung " #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, fuzzy, python-format msgid "Creditor name" msgstr "Kreditkarten Zahlung" @@ -243,7 +243,7 @@ msgid "Debit Card Payment" msgstr "EC-Kartenzahlung" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -625,7 +625,7 @@ msgid "PAIN Version" msgstr "PAIN Version" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po index d4c60dc..8e28af5 100644 --- a/account_banking_pain_base/i18n/es.po +++ b/account_banking_pain_base/i18n/es.po @@ -217,7 +217,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -242,7 +242,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -622,7 +622,7 @@ msgid "PAIN Version" msgstr "Versión PAIN" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index 33908d8..7d7cd01 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -217,7 +217,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -242,7 +242,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -605,7 +605,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/hr.po b/account_banking_pain_base/i18n/hr.po index cef41b3..28b189a 100644 --- a/account_banking_pain_base/i18n/hr.po +++ b/account_banking_pain_base/i18n/hr.po @@ -221,7 +221,7 @@ msgid "Credit Card Payment " msgstr "Ostala plaćanja" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, fuzzy, python-format msgid "Creditor name" msgstr "Ostala plaćanja" @@ -247,7 +247,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -611,7 +611,7 @@ msgid "PAIN Version" msgstr "PAIN verzija" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/it.po b/account_banking_pain_base/i18n/it.po index a39def6..baec1a4 100644 --- a/account_banking_pain_base/i18n/it.po +++ b/account_banking_pain_base/i18n/it.po @@ -217,7 +217,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -242,7 +242,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -605,7 +605,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/nb_NO.po b/account_banking_pain_base/i18n/nb_NO.po index fda8f06..bbc142b 100644 --- a/account_banking_pain_base/i18n/nb_NO.po +++ b/account_banking_pain_base/i18n/nb_NO.po @@ -221,7 +221,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -246,7 +246,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -609,7 +609,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po index 49e22ca..3764f6d 100644 --- a/account_banking_pain_base/i18n/nl.po +++ b/account_banking_pain_base/i18n/nl.po @@ -219,7 +219,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -244,7 +244,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -622,7 +622,7 @@ msgid "PAIN Version" msgstr "PAIN Versie" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/pt_BR.po b/account_banking_pain_base/i18n/pt_BR.po index 782e96c..6ba3c68 100644 --- a/account_banking_pain_base/i18n/pt_BR.po +++ b/account_banking_pain_base/i18n/pt_BR.po @@ -217,7 +217,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -242,7 +242,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -604,7 +604,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/i18n/sl.po b/account_banking_pain_base/i18n/sl.po index 3e53027..6dd8161 100644 --- a/account_banking_pain_base/i18n/sl.po +++ b/account_banking_pain_base/i18n/sl.po @@ -217,7 +217,7 @@ msgid "Credit Card Payment " msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:451 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:479 #, python-format msgid "Creditor name" msgstr "" @@ -242,7 +242,7 @@ msgid "Debit Card Payment" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:453 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:481 #, python-format msgid "Debtor name" msgstr "" @@ -607,7 +607,7 @@ msgid "PAIN Version" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:449 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:477 #, python-format msgid "Partner name" msgstr "" diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 5765ad8..c82f1e7 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -340,6 +340,28 @@ class AccountPaymentOrder(models.Model): % self.company_id.name) return True + @api.model + def has_fininst_postal_address(self, gen_args): + pain_flavor = gen_args.get('pain_flavor') + return ( + pain_flavor.startswith("pain.001.001.03") + or pain_flavor.startswith("pain.001.001.04") + or pain_flavor.startswith("pain.001.001.05") + or pain_flavor.startswith("pain.008.001.02") + or pain_flavor.startswith("pain.008.001.03") + or pain_flavor.startswith("pain.008.001.04") + ) + + @api.model + def generate_fininst_postal_address(self, parent_node, bank): + if not (bank.country or bank.city): + return + postal_address = etree.SubElement(parent_node, 'PstlAdr') + if bank.city: + etree.SubElement(postal_address, 'TwnNm').text = bank.city + if bank.country: + etree.SubElement(postal_address, 'Ctry').text = bank.country.code + @api.model def generate_party_agent( self, parent_node, party_type, order, partner_bank, gen_args, @@ -360,6 +382,9 @@ class AccountPaymentOrder(models.Model): party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = partner_bank.bank_bic + if self.has_fininst_postal_address(gen_args): + self.generate_fininst_postal_address( + party_agent_institution, partner_bank.bank_id) else: if order == 'B' or ( order == 'C' and gen_args['payment_method'] == 'DD'): @@ -367,6 +392,9 @@ class AccountPaymentOrder(models.Model): parent_node, '%sAgt' % party_type) party_agent_institution = etree.SubElement( party_agent, 'FinInstnId') + if self.has_fininst_postal_address(gen_args): + self.generate_fininst_postal_address( + party_agent_institution, partner_bank.bank_id) party_agent_other = etree.SubElement( party_agent_institution, 'Othr') party_agent_other_identification = etree.SubElement(