Skip to content

Commit

Permalink
[IMP] payment_{}: remove create from payment provider form
Browse files Browse the repository at this point in the history
before this commit, the create/new button is shown in
the payment provider form, where us it is removed in
the kanban and tree

after this commit, the create/new button will be removed
from the form and users can use duplicate option to create
new provider

closes odoo#134779

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
  • Loading branch information
niyasraphy committed Sep 8, 2023
1 parent 0a9f46d commit 5fd345e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions addons/payment/views/payment_provider_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<field name="name">payment.provider.form</field>
<field name="model">payment.provider</field>
<field name="arch" type="xml">
<form string="Payment provider">
<form string="Payment provider" create="0">
<field name="company_id" invisible="1"/>
<field name="is_published" invisible="1"/>
<field name="main_currency_id" invisible="1"/>
Expand Down Expand Up @@ -60,10 +60,6 @@
<button invisible="module_to_buy" type="object" class="btn btn-primary" name="button_immediate_install" string="Install"/>
</div>
</div>
<div id="provider_creation_warning" invisible="id" class="alert alert-warning" role="alert">
<strong>Warning</strong> Creating a payment provider from the <em>CREATE</em> button is not supported.
Please use the <em>Duplicate</em> action instead.
</div>
<group>
<group name="payment_state" invisible="module_state not in ('installed', False)">
<field name="code" groups="base.group_no_one" readonly="id"/>
Expand Down
2 changes: 1 addition & 1 deletion addons/payment_alipay/views/payment_provider_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="model">payment.provider</field>
<field name="inherit_id" ref="payment.payment_provider_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='provider_creation_warning']" position="after">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<div class="alert alert-danger"
role="alert"
invisible="code != 'alipay'">
Expand Down
2 changes: 1 addition & 1 deletion addons/payment_ogone/views/payment_provider_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="model">payment.provider</field>
<field name="inherit_id" ref="payment.payment_provider_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='provider_creation_warning']" position="after">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<div class="alert alert-danger"
role="alert"
invisible="code != 'ogone'">
Expand Down
2 changes: 1 addition & 1 deletion addons/payment_payulatam/views/payment_provider_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="model">payment.provider</field>
<field name="inherit_id" ref="payment.payment_provider_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='provider_creation_warning']" position="after">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<div class="alert alert-danger"
role="alert"
invisible="code != 'payulatam'">
Expand Down
2 changes: 1 addition & 1 deletion addons/payment_payumoney/views/payment_provider_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="model">payment.provider</field>
<field name="inherit_id" ref="payment.payment_provider_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='provider_creation_warning']" position="after">
<xpath expr="//div[hasclass('oe_title')]" position="after">
<div class="alert alert-danger"
role="alert"
invisible="code != 'payumoney'">
Expand Down

0 comments on commit 5fd345e

Please sign in to comment.