summaryrefslogtreecommitdiff
path: root/addons/pos_adyen/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/pos_adyen/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/pos_adyen/views')
-rw-r--r--addons/pos_adyen/views/adyen_account_views.xml68
-rw-r--r--addons/pos_adyen/views/point_of_sale_assets.xml9
-rw-r--r--addons/pos_adyen/views/pos_config_views.xml16
-rw-r--r--addons/pos_adyen/views/pos_payment_method_views.xml21
-rw-r--r--addons/pos_adyen/views/res_config_settings_views.xml20
5 files changed, 134 insertions, 0 deletions
diff --git a/addons/pos_adyen/views/adyen_account_views.xml b/addons/pos_adyen/views/adyen_account_views.xml
new file mode 100644
index 00000000..c31771d9
--- /dev/null
+++ b/addons/pos_adyen/views/adyen_account_views.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="adyen_account_view_form" model="ir.ui.view">
+ <field name="name">adyen.account.view.form.inherit.pos.adyen</field>
+ <field name="model">adyen.account</field>
+ <field name="inherit_id" ref="adyen_platforms.adyen_account_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//header" position="inside">
+ <button name="action_order_terminal" string="Order a Terminal" class="oe_highlight" type="object" attrs="{'invisible': [('adyen_uuid', '=', False)]}"/>
+ </xpath>
+ <xpath expr="//notebook" position="inside">
+ <page string="Stores">
+ <field name="store_ids">
+ <tree>
+ <field name="name"/>
+ <field name="store_uuid"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ </field>
+ </record>
+
+
+ <record id="adyen_store_view_form" model="ir.ui.view">
+ <field name="name">adyen.store.view.form</field>
+ <field name="model">adyen.store</field>
+ <field name="arch" type="xml">
+ <form string="Adyen Store">
+ <sheet>
+ <group>
+ <field name="store_uuid" attrs="{'invisible': [('id', '=', False)]}"/>
+ <field name="name" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="phone_number" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <label for="street" string="Address"/>
+ <div class="o_address_format">
+ <field name="street" placeholder="Street" class="o_address_street" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="house_number_or_name" placeholder="House number or name" class="o_address_street" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="city" placeholder="City" class="o_address_city" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="state_id" class="o_address_state" placeholder="State" options="{'no_open': True, 'no_quick_create': True}"
+ attrs="{'required': [('country_code', 'in', ['AU', 'CA', 'IT', 'US'])], 'readonly': [('id', '!=', False)]}"/>
+ <field name="zip" placeholder="ZIP" class="o_address_zip" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="country_id" placeholder="Country" class="o_address_country" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': [('id', '!=', False)]}"/>
+ <field name="country_code" invisible="1"/>
+ <field name="terminal_ids" attrs="{'invisible': [('terminal_ids', '=', [])]}"/>
+ </div>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_pos_adyen_account" model="ir.actions.server">
+ <field name="name">Adyen Account</field>
+ <field name="model_id" ref="model_adyen_account"/>
+ <field name="state">code</field>
+ <field name="code">
+ action = model.action_create_redirect()
+ </field>
+ </record>
+
+ <menuitem id="menu_pos_adyen_account"
+ parent="point_of_sale.menu_point_config_product"
+ action="action_pos_adyen_account"
+ sequence="5"
+ groups="point_of_sale.group_pos_manager,point_of_sale.group_pos_user"/>
+
+</odoo>
diff --git a/addons/pos_adyen/views/point_of_sale_assets.xml b/addons/pos_adyen/views/point_of_sale_assets.xml
new file mode 100644
index 00000000..bd738dcf
--- /dev/null
+++ b/addons/pos_adyen/views/point_of_sale_assets.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="assets" inherit_id="point_of_sale.assets">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/pos_adyen/static/src/js/payment_adyen.js"></script>
+ <script type="text/javascript" src="/pos_adyen/static/src/js/models.js"></script>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/pos_adyen/views/pos_config_views.xml b/addons/pos_adyen/views/pos_config_views.xml
new file mode 100644
index 00000000..51756d22
--- /dev/null
+++ b/addons/pos_adyen/views/pos_config_views.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="pos_config_view_form" model="ir.ui.view">
+ <field name="name">pos.config.form.view.inherit.pos_adyen</field>
+ <field name="model">pos.config</field>
+ <field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@id='tip_product']" position="after">
+ <div attrs="{'invisible': [('iface_tipproduct', '=', False)]}">
+ <field name="adyen_ask_customer_for_tip" class="oe_inline"/>
+ <label class="font-weight-normal" for="adyen_ask_customer_for_tip" string="Add tip through payment terminal (Adyen)"/>
+ </div>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/pos_adyen/views/pos_payment_method_views.xml b/addons/pos_adyen/views/pos_payment_method_views.xml
new file mode 100644
index 00000000..fe6ce37d
--- /dev/null
+++ b/addons/pos_adyen/views/pos_payment_method_views.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="pos_payment_method_view_form_inherit_pos_adyen" model="ir.ui.view">
+ <field name="name">pos.payment.method.form.inherit.adyen</field>
+ <field name="model">pos.payment.method</field>
+ <field name="inherit_id" ref="point_of_sale.pos_payment_method_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='use_payment_terminal']" position="after">
+ <!-- Adyen -->
+ <field name="adyen_api_key" attrs="{'invisible': [('use_payment_terminal', '!=', 'adyen')], 'required': [('use_payment_terminal', '=', 'adyen')]}"/>
+ <field name="adyen_terminal_identifier" attrs="{'invisible': [('use_payment_terminal', '!=', 'adyen')], 'required': [('use_payment_terminal', '=', 'adyen')]}"/>
+ <field name="adyen_test_mode" attrs="{'invisible': [('use_payment_terminal', '!=', 'adyen')], 'required': [('use_payment_terminal', '=', 'adyen')]}"/>
+
+ <!-- Odoo Payments by Adyen -->
+ <field name="adyen_account_id" invisible="1"/>
+ <field name="adyen_terminal_id" attrs="{'invisible': [('use_payment_terminal', '!=', 'odoo_adyen')], 'required': [('use_payment_terminal', '=', 'odoo_adyen')]}"/>
+ <field name="adyen_payout_id" attrs="{'invisible': [('use_payment_terminal', '!=', 'odoo_adyen')], 'required': [('use_payment_terminal', '=', 'odoo_adyen')]}" options="{'no_create': True}"/>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/pos_adyen/views/res_config_settings_views.xml b/addons/pos_adyen/views/res_config_settings_views.xml
new file mode 100644
index 00000000..4d999507
--- /dev/null
+++ b/addons/pos_adyen/views/res_config_settings_views.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="res_config_settings_view_form" model="ir.ui.view">
+ <field name="name">res.config.settings.view.form.inherit.point_of_sale</field>
+ <field name="model">res.config.settings</field>
+ <field name="priority" eval="95"/>
+ <field name="inherit_id" ref="base.res_config_settings_view_form" />
+ <field name="arch" type="xml">
+ <xpath expr="//div[@id='adyen_payment_terminal_setting']/div[hasclass('o_setting_right_pane')]" position="inside">
+ <span attrs="{'invisible': [('adyen_account_id', '=', False)]}">
+ <label for="adyen_account_id" string="Account"/>
+ <span class="fa fa-lg fa-building-o mr8" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
+ <field name="adyen_account_id"/>
+ </span>
+ <button name="create_adyen_account" icon="fa-arrow-right" type="object" class="btn-link" string="Create an account in 1 minute"
+ attrs="{'invisible': [('adyen_account_id', '!=', False)]}"/>
+ </xpath>
+ </field>
+ </record>
+</odoo>