mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-23 20:52:04 +00:00
ebics upload - select default format based upon suffix
This commit is contained in:
parent
000d14a7dc
commit
1dfa47c395
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2009-2020 Noviat.
|
# Copyright 2009-2021 Noviat.
|
||||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -86,12 +86,20 @@
|
|||||||
|
|
||||||
<!-- Upload formats -->
|
<!-- Upload formats -->
|
||||||
|
|
||||||
|
<record id="ebics_ff_LCR" model="ebics.file.format">
|
||||||
|
<field name="name">pain.xxx.cfonb160.dco</field>
|
||||||
|
<field name="type">up</field>
|
||||||
|
<field name="order_type">FUL</field>
|
||||||
|
<field name="description">Remises de LCR</field>
|
||||||
|
<field name="suffix">txt</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_CCT" model="ebics.file.format">
|
<record id="ebics_ff_CCT" model="ebics.file.format">
|
||||||
<field name="name">pain.001.001.03</field>
|
<field name="name">pain.001.001.03</field>
|
||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">CCT</field>
|
<field name="order_type">CCT</field>
|
||||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||||
<field name="suffix">cct.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_XE2" model="ebics.file.format">
|
<record id="ebics_ff_XE2" model="ebics.file.format">
|
||||||
@ -99,7 +107,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">XE2</field>
|
<field name="order_type">XE2</field>
|
||||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||||
<field name="suffix">cct.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_CDD" model="ebics.file.format">
|
<record id="ebics_ff_CDD" model="ebics.file.format">
|
||||||
@ -107,7 +115,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">CDD</field>
|
<field name="order_type">CDD</field>
|
||||||
<field name="description">Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
<field name="description">Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||||
<field name="suffix">sdd.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_XE3" model="ebics.file.format">
|
<record id="ebics_ff_XE3" model="ebics.file.format">
|
||||||
@ -115,7 +123,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">XE3</field>
|
<field name="order_type">XE3</field>
|
||||||
<field name="description">Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
<field name="description">Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||||
<field name="suffix">sdd.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_CDB" model="ebics.file.format">
|
<record id="ebics_ff_CDB" model="ebics.file.format">
|
||||||
@ -123,7 +131,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">CDB</field>
|
<field name="order_type">CDB</field>
|
||||||
<field name="description">Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
<field name="description">Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||||
<field name="suffix">sbb.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_XE4" model="ebics.file.format">
|
<record id="ebics_ff_XE4" model="ebics.file.format">
|
||||||
@ -131,7 +139,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">XE4</field>
|
<field name="order_type">XE4</field>
|
||||||
<field name="description">Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
<field name="description">Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||||
<field name="suffix">sbb.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ebics_ff_FUL_pain_001_001_02_sct" model="ebics.file.format">
|
<record id="ebics_ff_FUL_pain_001_001_02_sct" model="ebics.file.format">
|
||||||
@ -139,7 +147,7 @@
|
|||||||
<field name="type">up</field>
|
<field name="type">up</field>
|
||||||
<field name="order_type">FUL</field>
|
<field name="order_type">FUL</field>
|
||||||
<field name="description">Payment Order in format pain.001.001.02</field>
|
<field name="description">Payment Order in format pain.001.001.02</field>
|
||||||
<field name="suffix">cct.xml</field>
|
<field name="suffix">xml</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
@ -411,7 +411,7 @@ ul.auto-toc {
|
|||||||
<li><p class="first">account_bank_statement_import_helper</p>
|
<li><p class="first">account_bank_statement_import_helper</p>
|
||||||
<p>Required if you are processing bank statements with local bank account numbers (e.g. french CFONB files).</p>
|
<p>Required if you are processing bank statements with local bank account numbers (e.g. french CFONB files).</p>
|
||||||
<p>The import helper will match the local bank account number with the IBAN number specified on the Odoo Financial journal.</p>
|
<p>The import helper will match the local bank account number with the IBAN number specified on the Odoo Financial journal.</p>
|
||||||
<p>Cf. <a class="reference external" href="https://github.com/noviat-apps">https://github.com/noviat-apps</a></p>
|
<p>Cf. <a class="reference external" href="https://github.com/Noviat/noviat-apps">https://github.com/Noviat/noviat-apps</a></p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="line-block">
|
<div class="line-block">
|
||||||
|
@ -120,10 +120,15 @@ class EbicsXfer(models.TransientModel):
|
|||||||
@api.onchange('upload_data')
|
@api.onchange('upload_data')
|
||||||
def _onchange_upload_data(self):
|
def _onchange_upload_data(self):
|
||||||
self.upload_fname_dummy = self.upload_fname
|
self.upload_fname_dummy = self.upload_fname
|
||||||
|
self.format_id = False
|
||||||
self._detect_upload_format()
|
self._detect_upload_format()
|
||||||
|
if not self.format_id:
|
||||||
upload_formats = self.format_id \
|
upload_formats = self.format_id \
|
||||||
or self.ebics_config_id.ebics_file_format_ids.filtered(
|
or self.ebics_config_id.ebics_file_format_ids.filtered(
|
||||||
lambda r: r.type == 'up')
|
lambda r: r.type == 'up')
|
||||||
|
if len(upload_formats) > 1:
|
||||||
|
upload_formats = upload_formats.filtered(
|
||||||
|
lambda r: self.upload_fname.endswith(r.suffix))
|
||||||
if len(upload_formats) == 1:
|
if len(upload_formats) == 1:
|
||||||
self.format_id = upload_formats
|
self.format_id = upload_formats
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user