Automatic Update form OCA2FC Migrator

This commit is contained in:
Flectra Community Bot 2021-05-26 13:44:26 +02:00 committed by Renzo Meister
parent d46438712a
commit f6542d28cc
13 changed files with 60 additions and 32 deletions

View File

@ -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_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_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_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_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 [account_banking_mandate](account_banking_mandate/) | 2.0.2.0.1| Banking mandates

View File

@ -6,7 +6,7 @@
{ {
'name': 'Account Banking PAIN Base Module', 'name': 'Account Banking PAIN Base Module',
'summary': 'Base module for PAIN file generation', 'summary': 'Base module for PAIN file generation',
'version': '2.0.1.0.2', 'version': '2.0.1.0.3',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': "Akretion, " 'author': "Akretion, "
"Noviat, " "Noviat, "

View File

@ -207,7 +207,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -231,7 +231,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -574,7 +574,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -218,7 +218,7 @@ msgid "Credit Card Payment "
msgstr "Kreditkarten Zahlung " msgstr "Kreditkarten Zahlung "
#. module: account_banking_pain_base #. 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 #, fuzzy, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "Kreditkarten Zahlung" msgstr "Kreditkarten Zahlung"
@ -243,7 +243,7 @@ msgid "Debit Card Payment"
msgstr "EC-Kartenzahlung" msgstr "EC-Kartenzahlung"
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -625,7 +625,7 @@ msgid "PAIN Version"
msgstr "PAIN Version" msgstr "PAIN Version"
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -217,7 +217,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -242,7 +242,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -622,7 +622,7 @@ msgid "PAIN Version"
msgstr "Versión PAIN" msgstr "Versión PAIN"
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -217,7 +217,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -242,7 +242,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -605,7 +605,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -221,7 +221,7 @@ msgid "Credit Card Payment "
msgstr "Ostala plaćanja" msgstr "Ostala plaćanja"
#. module: account_banking_pain_base #. 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 #, fuzzy, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "Ostala plaćanja" msgstr "Ostala plaćanja"
@ -247,7 +247,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -611,7 +611,7 @@ msgid "PAIN Version"
msgstr "PAIN verzija" msgstr "PAIN verzija"
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -217,7 +217,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -242,7 +242,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -605,7 +605,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -221,7 +221,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -246,7 +246,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -609,7 +609,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -219,7 +219,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -244,7 +244,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -622,7 +622,7 @@ msgid "PAIN Version"
msgstr "PAIN Versie" msgstr "PAIN Versie"
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -217,7 +217,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -242,7 +242,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -604,7 +604,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -217,7 +217,7 @@ msgid "Credit Card Payment "
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Creditor name" msgid "Creditor name"
msgstr "" msgstr ""
@ -242,7 +242,7 @@ msgid "Debit Card Payment"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Debtor name" msgid "Debtor name"
msgstr "" msgstr ""
@ -607,7 +607,7 @@ msgid "PAIN Version"
msgstr "" msgstr ""
#. module: account_banking_pain_base #. 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 #, python-format
msgid "Partner name" msgid "Partner name"
msgstr "" msgstr ""

View File

@ -340,6 +340,28 @@ class AccountPaymentOrder(models.Model):
% self.company_id.name) % self.company_id.name)
return True 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 @api.model
def generate_party_agent( def generate_party_agent(
self, parent_node, party_type, order, partner_bank, gen_args, 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_bic = etree.SubElement(
party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_institution, gen_args.get('bic_xml_tag'))
party_agent_bic.text = partner_bank.bank_bic 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: else:
if order == 'B' or ( if order == 'B' or (
order == 'C' and gen_args['payment_method'] == 'DD'): order == 'C' and gen_args['payment_method'] == 'DD'):
@ -367,6 +392,9 @@ class AccountPaymentOrder(models.Model):
parent_node, '%sAgt' % party_type) parent_node, '%sAgt' % party_type)
party_agent_institution = etree.SubElement( party_agent_institution = etree.SubElement(
party_agent, 'FinInstnId') 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_other = etree.SubElement(
party_agent_institution, 'Othr') party_agent_institution, 'Othr')
party_agent_other_identification = etree.SubElement( party_agent_other_identification = etree.SubElement(