summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordip-odoo <dip@odoo.com>2017-07-28 11:15:47 +0530
committerRichard Mathot <rim@odoo.com>2017-08-09 16:58:47 +0200
commit8af86692ade688172edfea9d8c42c51173b3a301 (patch)
treeecf31ef1399f95686a4ed0d9493208443d6323e3
parentc1a3411bfbc4fe4a5c6fd8032cd78a92e6787758 (diff)
[IMP] payment_authorize: display Authorize.net Profile ID on payment tokens
-rw-r--r--addons/payment_authorize/models/payment.py2
-rw-r--r--addons/payment_authorize/views/payment_views.xml12
2 files changed, 14 insertions, 0 deletions
diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py
index 93e5c5da098..d018652b19f 100644
--- a/addons/payment_authorize/models/payment.py
+++ b/addons/payment_authorize/models/payment.py
@@ -327,6 +327,8 @@ class PaymentToken(models.Model):
authorize_profile = fields.Char(string='Authorize.net Profile ID', help='This contains the unique reference '
'for this partner/payment token combination in the Authorize.net backend')
+ provider = fields.Selection(string='Provider', related='acquirer_id.provider')
+ save_token = fields.Selection(string='Save Cards', related='acquirer_id.save_token')
@api.model
def authorize_create(self, values):
diff --git a/addons/payment_authorize/views/payment_views.xml b/addons/payment_authorize/views/payment_views.xml
index 7a957e41442..0237325e0c2 100644
--- a/addons/payment_authorize/views/payment_views.xml
+++ b/addons/payment_authorize/views/payment_views.xml
@@ -15,4 +15,16 @@
</field>
</record>
+ <record id="token_form_authorize_net" model="ir.ui.view">
+ <field name='name'>payment.token.form</field>
+ <field name='model'>payment.token</field>
+ <field name="inherit_id" ref="payment.payment_token_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr='//field[@name="acquirer_ref"]' position='after'>
+ <field name="authorize_profile" attrs="{'invisible':['|', ('provider', '!=', 'authorize'), ('save_token', '=', 'none')]}"/>
+ <field name="provider" invisible='1'/>
+ <field name="save_token" invisible='1'/>
+ </xpath>
+ </field>
+ </record>
</odoo>