[IMP] payment_{}: remove create from payment provider form

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/odoo#134779

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
niyasraphy
2023-09-08 12:24:51 +00:00
parent 0a9f46d992
commit 5fd345ea83
5 changed files with 5 additions and 9 deletions
@@ -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"/>
@@ -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"/>
@@ -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'">
@@ -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'">
@@ -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'">
@@ -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'">