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
Alexis de Lattre
parent
b31ed2c7dc
commit
4d20363be4
@@ -13,6 +13,8 @@ class AccountConfigSettings(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.'
|
||||
|
||||
@@ -28,3 +28,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")
|
||||
|
||||
@@ -286,6 +286,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:
|
||||
@@ -294,6 +297,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')
|
||||
|
||||
@@ -21,6 +21,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.")
|
||||
|
||||
@api.one
|
||||
def _default_initiating_party(self):
|
||||
|
||||
@@ -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