summaryrefslogtreecommitdiff
path: root/addons/payment
diff options
context:
space:
mode:
authorsed-odoo <sed@odoo.com>2018-09-04 08:34:41 +0200
committersed-odoo <sed@odoo.com>2018-09-20 09:41:06 +0200
commit3a883e67287cbf0c93a746bc2080b897f2c87bfa (patch)
tree86924a931dc0045143646cc0c1d0e198dc09339b /addons/payment
parentc59d6d2329494705a5f9dd5ef6a1b0e2c43f8e38 (diff)
[IMP] l10n_ch,account,website_sale: Add SwissQR Code on invoice and improve the SEPA QR Code usability
Purpose ======= - Add the SwissQR Code on the invoice in aim to replace the actual ISR - Improve the settings of the SEPA QR Code to make it more user friendly Specifications ============== - ln_ch: - Add a SwissQR Code on the invoice to fit the Switzerland QR-Bill Format - Use the "partner_bank_id" field to generate the QR Code - Add function to get the address number out of the field "street" and "street2" - account: - Remove the SEPA QR Code's journal settings from the general setting - Display the "partner_bank_id" field on the invoice "Other info" page - Use the "partner_bank_id" field to generate the QR Code - website_sale: - Add a check box on the payment acquirers to use the SEPA QR Code on the e-commerce - Use the payment acquirer "journal_id" field to generate the SEPA QR Code
Diffstat (limited to 'addons/payment')
-rw-r--r--addons/payment/models/payment_acquirer.py1
-rw-r--r--addons/payment/views/payment_portal_templates.xml28
-rw-r--r--addons/payment/views/payment_views.xml1
3 files changed, 18 insertions, 12 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 3da56665b26..64e7f02436b 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -143,6 +143,7 @@ class PaymentAcquirer(models.Model):
fees_dom_var = fields.Float('Variable domestic fees (in percents)')
fees_int_fixed = fields.Float('Fixed international fees')
fees_int_var = fields.Float('Variable international fees (in percents)')
+ qr_code = fields.Boolean('Use SEPA QR Code')
# TDE FIXME: remove that brol
module_id = fields.Many2one('ir.module.module', string='Corresponding Module')
diff --git a/addons/payment/views/payment_portal_templates.xml b/addons/payment/views/payment_portal_templates.xml
index 0676107c698..bac8783fcea 100644
--- a/addons/payment/views/payment_portal_templates.xml
+++ b/addons/payment/views/payment_portal_templates.xml
@@ -100,12 +100,14 @@
<span name="form_amount" class="form-control" t-esc="tx.amount" t-options="{'widget': 'monetary', 'display_currency': tx.currency_id}"/>
</div>
</div>
- <div t-if="tx.acquirer_id.company_id.qr_code and tx.acquirer_id.company_id.qr_code_valid and (tx.currency_id.name == 'EUR')">
- <h3>Or scan me with your banking app.</h3>
- <img class="border border-dark rounded" t-att-src="tx.acquirer_id.company_id.qr_code_payment_journal_id.bank_account_id.build_qr_code_url(tx.amount,tx.reference)"/>
- </div>
- <div t-if="tx.acquirer_id.company_id.qr_code and (tx.acquirer_id.company_id.qr_code_valid == False) and (tx.currency_id.name == 'EUR')">
- <h3>The SEPA QR Code informations are not set correctly.</h3>
+ <div t-if="(tx.acquirer_id.qr_code == True) and (tx.currency_id.name == 'EUR')">
+ <div t-if="tx.acquirer_id.journal_id.bank_account_id.qr_code_valid">
+ <h3>Or scan me with your banking app.</h3>
+ <img class="border border-dark rounded" t-att-src="tx.acquirer_id.journal_id.bank_account_id.build_qr_code_url(tx.amount,tx.reference)"/>
+ </div>
+ <div t-if="(tx.acquirer_id.journal_id.bank_account_id.qr_code_valid == False)">
+ <h3>The SEPA QR Code informations are not set correctly.</h3>
+ </div>
</div>
<div>
<a role="button" t-attf-class="btn btn-#{status} float-right" href="/my/home"><i class="fa fa-arrow-circle-right"/> Back to My Account</a>
@@ -137,12 +139,14 @@
<div t-if="thanks_msg and payment_tx_id.acquirer_id.provider == 'transfer' and reference">
<b>Communication: </b><span t-esc='reference'/>
</div>
- <div t-if="payment_tx_id.acquirer_id.company_id.qr_code and payment_tx_id.acquirer_id.company_id.qr_code_valid and (payment_tx_id.currency_id.name == 'EUR')">
- <h3>Or scan me with your banking app.</h3>
- <img class="border border-dark rounded" t-att-src="payment_tx_id.acquirer_id.company_id.qr_code_payment_journal_id.bank_account_id.build_qr_code_url(payment_tx_id.amount,payment_tx_id.reference)"/>
- </div>
- <div t-if="payment_tx_id.acquirer_id.company_id.qr_code and (payment_tx_id.acquirer_id.company_id.qr_code_valid == False) and (payment_tx_id.currency_id.name == 'EUR')">
- <h3>The SEPA QR Code informations are not set correctly.</h3>
+ <div t-if="(payment_tx_id.partner_id.country_id.code in ['BE', 'AT', 'DE', 'FI', 'NL']) and (payment_tx_id.acquirer_id.qr_code == True) and (payment_tx_id.currency_id.name == 'EUR')">
+ <div t-if="payment_tx_id.acquirer_id.journal_id.bank_account_id.qr_code_valid">
+ <h3>Or scan me with your banking app.</h3>
+ <img class="border border-dark rounded" t-att-src="payment_tx_id.acquirer_id.journal_id.bank_account_id.build_qr_code_url(payment_tx_id.amount,payment_tx_id.reference)"/>
+ </div>
+ <div t-if="(payment_tx_id.acquirer_id.journal_id.bank_account_id.qr_code_valid == False)">
+ <h3>The SEPA QR Code informations are not set correctly.</h3>
+ </div>
</div>
</div>
<div t-if="payment_tx_id and payment_tx_id.state == 'authorized'" class="alert alert-success alert-dismissable" role="alert">
diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml
index 913e828e8e2..1a92edccfe3 100644
--- a/addons/payment/views/payment_views.xml
+++ b/addons/payment/views/payment_views.xml
@@ -91,6 +91,7 @@
<field name="fees_int_fixed" attrs="{'invisible': [('fees_active', '=', False)]}"/>
<field name="fees_int_var" attrs="{'invisible': [('fees_active', '=', False)]}"/>
<field name="specific_countries"/>
+ <field name="qr_code" attrs="{'invisible': [('provider', '!=', 'transfer')]}"/>
<field name="country_ids" widget="many2many_tags" attrs="{'invisible': [('specific_countries', '=', False)]}"/>
<label for="view_template_id" groups="base.group_no_one"/>
<div groups="base.group_no_one">