flectra/addons/payment/views/payment_views.xml

454 lines
25 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<!-- Payment menu in settings -->
<menuitem
name='Payments'
id='root_payment_menu'
parent='account.menu_finance_configuration'/>
<record id="acquirer_form" model="ir.ui.view">
<field name="name">payment.acquirer.form</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<form string="Payment Acquirer">
<field name="environment" invisible='1'/>
<field name="fees_implemented" invisible='1'/>
<field name="token_implemented" invisible='1'/>
<field name="authorize_implemented" invisible="1"/>
<sheet>
<field name="module_id" invisible="1"/>
<field name="module_state" invisible="1"/>
<div class="oe_button_box" name="button_box" attrs="{'invisible': ['&amp;', ('module_id', '!=', False), ('module_state', '!=', 'installed')]}">
<!-- transfer referenced here due to view inheritance issue in current master (post-saas-16) -->
<button name="toggle_environment_value"
attrs="{'invisible': ['|', ('environment', '=', 'test'), ('provider', '=', 'transfer')]}"
class="oe_stat_button"
type="object" icon="fa-play">
<div class="o_stat_info o_field_widget">
<span class="text-success">Production</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<!-- transfer referenced here due to view inheritance issue in current master (post-saas-16) -->
<button name="toggle_environment_value"
attrs="{'invisible': ['|', ('environment', '=', 'prod'), ('provider', '=', 'transfer')]}"
class="oe_stat_button"
type="object" icon="fa-stop">
<div class="o_stat_info o_field_widget">
<span class="o_warning_text">Test</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<button name="toggle_website_published"
class="oe_stat_button"
type="object" icon="fa-globe">
<field name="website_published" widget="boolean_button"
options='{"terminology": {"string_true": "Published", "hover_false": "Publish"}}'/>
</button>
</div>
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<h1><field name="name" placeholder="Name"/></h1>
</div>
<div attrs="{'invisible': ['|', ('module_state', '=', 'installed'), ('module_id', '=', False)]}">
<button type="object" class="btn btn-primary" name="button_immediate_install" string="Install"/>
<div class="o_payment_acquirer_desc">
<field name="description"/>
</div>
</div>
<group name="acquirer_base" col="2" attrs="{'invisible': ['&amp;', ('module_id', '!=', False), ('module_state', '!=', 'installed')]}">
<group name="acquirer_left">
<field name="provider" groups="base.group_no_one"/>
<field name="company_id" groups="base.group_multi_company" options='{"no_open":True}'/>
</group>
</group>
<notebook attrs="{'invisible': ['&amp;', ('module_id', '!=', False), ('module_state', '!=', 'installed')]}">
<page string="Credentials" name="acquirer_credentials">
<group name="acquirer">
</group>
</page>
<page string="Messages">
<group>
<field name="pre_msg"/>
<field name="post_msg"/>
<field name="pending_msg"/>
<field name="done_msg"/>
<field name="cancel_msg"/>
<field name="error_msg"/>
</group>
</page>
<page string="Configuration">
<group name="acquirer_config">
<field name="journal_id" context="{'default_type': 'bank'}" required="1"/>
<field name="capture_manually" attrs="{'invisible': [('authorize_implemented', '=', False)]}"/>
<field name="save_token" widget="radio" attrs="{'invisible': ['|', ('token_implemented', '=', False), ('payment_flow', '=', 's2s')]}"/>
<field name="fees_active" attrs="{'invisible': [('fees_implemented', '=', False)]}"/>
<field name="fees_dom_fixed" attrs="{'invisible': [('fees_active', '=', False)]}"/>
<field name="fees_dom_var" attrs="{'invisible': [('fees_active', '=', False)]}"/>
<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="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">
<field name="view_template_id" nolabel="1"/>
<div>
This template renders the acquirer button with all necessary values.
It is rendered with qWeb with the following evaluation context:
<ul>
<li>tx_url: transaction URL to post the form</li>
<li>acquirer: payment.acquirer browse record</li>
<li>user: current user browse record</li>
<li>reference: the transaction reference number</li>
<li>currency: the transaction currency browse record</li>
<li>amount: the transaction amount, a float</li>
<li>partner: the buyer partner browse record, not necessarily set</li>
<li>partner_values: specific values about the buyer, for example coming from a shipping form</li>
<li>tx_values: transaction values</li>
<li>context: the current context dictionary</li>
</ul>
</div>
</div>
<field name="registration_view_template_id" groups="base.group_no_one"/>
<field name="payment_icon_ids" widget="many2many_tags"/>
<field name="payment_flow" widget="radio"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Acquirer Kanban View -->
<record id="acquirer_kanban" model="ir.ui.view">
<field name="name">payment.acquirer.kanban</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<kanban quick_create="false" create="true" class="o_kanban_payment_acquirer">
<field name="id"/>
<field name="name"/>
<field name="description"/>
<field name="environment"/>
<field name="provider"/>
<field name="module_id"/>
<field name="module_state"/>
<field name="website_published"/>
<templates>
<t t-name="kanban-box">
<t t-set="installed" t-value="!record.module_id.value || (record.module_id.value &amp;&amp; record.module_state.raw_value === 'installed')"/>
<div t-attf-class="oe_kanban_global_click #{installed and record.website_published.raw_value ? 'oe_kanban_color_5' : 'oe_kanban_color_white'}">
<div class="o_kanban_image">
<img type="open" t-att-src="kanban_image('payment.acquirer', 'image_small', record.id.raw_value)"/>
</div>
<div class="o_payment_acquirer_desc">
<h3 class="mt4"><t t-esc="record.name.value"/></h3>
<t t-if="record.description.raw_value" t-raw="record.description.raw_value"/>
</div>
<div class="o_payment_acquirer_bottom">
<t t-if="installed">
<field name="environment" widget="label_selection" options="{'classes': {'test': 'warning', 'production': 'success'}}"/>
</t>
<button t-if="!installed" type="object" class="btn btn-default pull-right btn-sm" name="button_immediate_install">Install</button>
<button t-if="installed and !record.website_published.raw_value" type="edit" class="btn btn-primary pull-right btn-sm">Activate</button>
<button t-if="installed and record.website_published.raw_value" type="edit" class="btn btn-primary pull-right btn-sm">Configure</button>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="acquirer_list" model="ir.ui.view">
<field name="name">payment.acquirer.list</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<tree string="Payment Acquirers">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="provider"/>
<field name="website_published"/>
<field name="environment"/>
</tree>
</field>
</record>
<record id="acquirer_search" model="ir.ui.view">
<field name="name">payment.acquirer.search</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="provider"/>
<group expand="0" string="Group By">
<filter string="Provider" name="provider" domain="[]" context="{'group_by': 'provider'}"/>
<filter string="Environment" name="environment" domain="[]" context="{'group_by': 'environment'}"/>
</group>
</search>
</field>
</record>
<record id="action_payment_acquirer" model="ir.actions.act_window">
<field name="name">Payment Acquirers</field>
<field name="res_model">payment.acquirer</field>
<field name='view_type'>form</field>
<field name='view_mode'>kanban,tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a payment acquirer.
</p>
</field>
</record>
<menuitem
action='action_payment_acquirer'
id='payment_acquirer_menu'
parent='root_payment_menu'
sequence='10' />
<!-- Payment transactions -->
<record id="transaction_form" model="ir.ui.view">
<field name="name">payment.transaction.form</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<form string="Payment Transactions">
<header>
<button type="object" name="action_capture" states="authorized" string="Capture Transaction" class="oe_highlight"/>
<button type="object" name="action_void" states="authorized" string="Void Transaction"/>
<field name="state" widget="statusbar" clickable="True"/>
</header>
<sheet>
<group>
<group>
<field name="reference"/>
<label for="amount"/>
<div class="o_row">
<field name="amount"/>
<field name="currency_id" options="{'no_open': True, 'no_create': True}"/>
</div>
<field name="fees" readonly="1"/>
<label for="partner_id"/>
<div>
<field name="partner_id" context="{'show_address': 1}" options="{'always_reload': True}"/>
<div name="partner_details" class="o_address_format" attrs="{'invisible': [('partner_id', '!=', False)]}">
<field name="partner_name" placeholder="Name" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_street"/>
<field name="partner_address" placeholder="Address" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_street"/>
<field name="partner_city" placeholder="City" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_city"/>
<field name="partner_zip" placeholder="ZIP" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_zip"/>
<field name="partner_country_id" placeholder="Country" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_country"/>
<field name="partner_lang" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_street"/>
<field name="partner_email" placeholder="E-mail" attrs="{'readonly': [('partner_id', '!=', False)]}" class="o_address_street"/>
</div>
</div>
</group>
<group>
<field name="acquirer_id"/>
<field name="provider" invisible="1"/>
<field name="payment_token_id" options="{'no_create': True}"/>
<field name="acquirer_reference" readonly="1"/>
<field name="create_date"/>
<field name="date_validate"/>
</group>
</group>
<group string="Message">
<field name="state_message" nolabel="1"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="transaction_list" model="ir.ui.view">
<field name="name">payment.transaction.list</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<tree string="Payment Transactions">
<field name="reference"/>
<field name="create_date"/>
<field name="acquirer_id"/>
<field name="partner_id"/>
<field name="partner_name"/>
<field name="amount"/>
<field name="fees"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="transaction_view_kanban" model="ir.ui.view">
<field name="name">payment.transaction.kanban</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-xs-6">
<strong><field name="reference"/></strong>
</div>
<div class="col-xs-6">
<span class="pull-right"><field name="create_date"/></span>
</div>
<div class="col-xs-6">
<span><field name="partner_name"/></span>
</div>
<div class="col-xs-6">
<span class="pull-right">
<field name="amount" widget="monetary"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="transaction" model="ir.ui.view">
<field name="name">payment.transaction.search</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<search>
<field name="reference"/>
<field name="acquirer_id"/>
<field name="partner_id"/>
<field name="partner_name"/>
</search>
</field>
</record>
<record id="action_payment_transaction" model="ir.actions.act_window">
<field name="name">Payment Transactions</field>
<field name="res_model">payment.transaction</field>
<field name='view_type'>form</field>
<field name='view_mode'>tree,kanban,form</field>
</record>
<menuitem
action='action_payment_transaction'
id='payment_transaction_menu'
parent='root_payment_menu'
groups="base.group_no_one"
sequence='20' />
<!-- Payment Tokens -->
<record model='ir.ui.view' id='payment_token_tree_view'>
<field name='name'>payment.token.tree</field>
<field name='model'>payment.token</field>
<field name='arch' type='xml'>
<tree string='Payment Tokens'>
<field name="name"/>
<field name="active"/>
<field name='partner_id' />
<field name='acquirer_id' readonly='1'/>
<field name='acquirer_ref' readonly='1'/>
</tree>
</field>
</record>
<record id='payment_token_view_search' model='ir.ui.view'>
<field name='name'>payment.token.search</field>
<field name='model'>payment.token</field>
<field name='arch' type='xml'>
<search string='Payment Tokens'>
<field name='partner_id'/>
</search>
</field>
</record>
<record id="action_payment_tx_ids" model="ir.actions.act_window">
<field name="name">Payment Transactions</field>
<field name="res_model">payment.transaction</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('payment_token_id','=', active_id)]</field>
<field name="context">{'create': False}</field>
</record>
<record model='ir.ui.view' id='payment_token_form_view'>
<field name='name'>payment.token.form</field>
<field name='model'>payment.token</field>
<field name='arch' type='xml'>
<form string='Payment Tokens' create='false' editable='bottom'>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" name="%(action_payment_tx_ids)d"
type="action" icon="fa-money" string="Payments">
</button>
</div>
<group>
<field name="name"/>
<field name='partner_id' />
</group>
<group>
<field name="active"/>
<field name='acquirer_id'/>
<field name='acquirer_ref'/>
</group>
</sheet>
</form>
</field>
</record>
<record model='ir.actions.act_window' id='payment_token_action'>
<field name='name'>Saved Payment Data</field>
<field name='res_model'>payment.token</field>
<field name='view_type'>form</field>
<field name='view_mode'>tree,form</field>
</record>
<menuitem
action='payment_token_action'
id='payment_token_menu'
parent='root_payment_menu'
groups='base.group_no_one'/>
<!-- Payment icons -->
<record model="ir.ui.view" id="payment_icon_form_view">
<field name="name">payment.icon.form</field>
<field name="model">payment.icon</field>
<field name="arch" type="xml">
<form string="Payment Icon">
<sheet>
<field name="image" widget="image" class="oe_avatar"/>
<div class="oe_title">
<h1><field name="name" placeholder="Name"/></h1>
</div>
<group group="base.group_no_one">
<notebook>
<page string="Acquirers list">
<field nolabel="1" name="acquirer_ids"/>
</page>
</notebook>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_payment_icon" model="ir.actions.act_window">
<field name="name">Payment Icons</field>
<field name="res_model">payment.icon</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a payment icon.
</p>
</field>
</record>
<menuitem
action="action_payment_icon"
id="payment_icon_menu"
parent="root_payment_menu"
groups="base.group_no_one"/>
</data>
</flectra>