mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[ADD] sepa: support Initiating Party Scheme
This commit is contained in:
committed by
Stéphane Bidoul (ACSONE)
parent
af07e8e2f4
commit
186593d5e4
@@ -27,3 +27,9 @@ class AccountPaymentMode(models.Model):
|
||||
"- Country code (2, optional)\n"
|
||||
"- Company idenfier (N, VAT)\n"
|
||||
"- Service suffix (N, issued by bank)")
|
||||
initiating_party_scheme = fields.Char(
|
||||
string='Initiating Party Scheme', size=35,
|
||||
help="This will be used as the 'Initiating Party Scheme Name' in "
|
||||
"the PAIN files generated by Odoo. This value is determined by the "
|
||||
"financial institution that will process the file. If not defined, "
|
||||
"no scheme will be used.\n")
|
||||
|
||||
@@ -284,6 +284,9 @@ class AccountPaymentOrder(models.Model):
|
||||
initiating_party_issuer = (
|
||||
self.payment_mode_id.initiating_party_issuer or
|
||||
self.payment_mode_id.company_id.initiating_party_issuer)
|
||||
initiating_party_scheme = (
|
||||
self.payment_mode_id.initiating_party_scheme or
|
||||
self.payment_mode_id.company_id.initiating_party_scheme)
|
||||
# in pain.008.001.02.ch.01.xsd files they use
|
||||
# initiating_party_identifier but not initiating_party_issuer
|
||||
if initiating_party_identifier:
|
||||
@@ -292,6 +295,12 @@ class AccountPaymentOrder(models.Model):
|
||||
iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr')
|
||||
iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id')
|
||||
iniparty_org_other_id.text = initiating_party_identifier
|
||||
if initiating_party_scheme:
|
||||
iniparty_org_other_scheme = etree.SubElement(
|
||||
iniparty_org_other, 'SchmeNm')
|
||||
iniparty_org_other_scheme_name = etree.SubElement(
|
||||
iniparty_org_other_scheme, 'Prtry')
|
||||
iniparty_org_other_scheme_name.text = initiating_party_scheme
|
||||
if initiating_party_issuer:
|
||||
iniparty_org_other_issuer = etree.SubElement(
|
||||
iniparty_org_other, 'Issr')
|
||||
|
||||
@@ -20,6 +20,10 @@ class ResCompany(models.Model):
|
||||
string='Initiating Party Identifier', size=35,
|
||||
help="This will be used as the 'Initiating Party Identifier' in "
|
||||
"the PAIN files generated by Odoo.")
|
||||
initiating_party_scheme = fields.Char(
|
||||
string='Initiating Party Scheme', size=35,
|
||||
help="This will be used as the 'Initiating Party Scheme Name' in "
|
||||
"the PAIN files generated by Odoo.")
|
||||
|
||||
def _default_initiating_party(self):
|
||||
'''This method is called from post_install.py'''
|
||||
|
||||
@@ -12,6 +12,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
related='company_id.initiating_party_issuer')
|
||||
initiating_party_identifier = fields.Char(
|
||||
related='company_id.initiating_party_identifier')
|
||||
initiating_party_scheme = fields.Char(
|
||||
related='company_id.initiating_party_scheme')
|
||||
group_pain_multiple_identifier = fields.Boolean(
|
||||
string='Multiple identifiers',
|
||||
implied_group='account_banking_pain_base.'
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<group name="main" position="inside">
|
||||
<field name="initiating_party_identifier" groups="account_banking_pain_base.group_pain_multiple_identifier"/>
|
||||
<field name="initiating_party_issuer" groups="account_banking_pain_base.group_pain_multiple_identifier"/>
|
||||
<field name="initiating_party_scheme" groups="account_banking_pain_base.group_pain_multiple_identifier"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user