summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorhch-odoo <hch@odoo.com>2017-07-04 20:07:30 +0530
committerqdp-odoo <qdp@odoo.com>2017-07-04 16:37:30 +0200
commit4e593abb2f191ef30fc99c25cd91c82d00b808d8 (patch)
treeb75c5e3abe2c34f11a6d5c9a82be2499077ac513 /addons
parent6f4a40ab672b7da8167215893504a8f17075fc7c (diff)
[IMP] account: Show cancel button only when account_cancel is installed
Because 'Allow Cancelling Entries' option for journals is made available only when the 'account_cancel' module is installed Was PR #17216
Diffstat (limited to 'addons')
-rw-r--r--addons/account/views/account_invoice_view.xml2
-rw-r--r--addons/account/views/account_view.xml1
-rw-r--r--addons/account_cancel/views/account_views.xml16
3 files changed, 14 insertions, 5 deletions
diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml
index 619476fb240..27b705532fe 100644
--- a/addons/account/views/account_invoice_view.xml
+++ b/addons/account/views/account_invoice_view.xml
@@ -220,7 +220,6 @@
<button name="action_invoice_open" type="object" states="draft" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
<button name="%(action_account_invoice_payment)d" type="action" states="open" string="Register Payment" groups="account.group_account_invoice" class="oe_highlight"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Ask for a Credit Note' groups="account.group_account_invoice" attrs="{'invisible': ['|',('type', 'in', ['in_refund','out_refund']),('state','not in',('open','paid'))]}"/>
- <button name="action_invoice_cancel" type="object" states="draft" string="Cancel Bill" groups="account.group_account_invoice"/>
<button name="action_invoice_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar" statusbar_visible="draft,open,paid" />
</header>
@@ -356,7 +355,6 @@
<button name="%(action_account_invoice_payment)d" id="account_invoice_payment_btn" type="action" states="open" string="Register Payment" groups="account.group_account_invoice" class="oe_highlight"/>
<button name="action_invoice_open" type="object" states="draft" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Add Credit Note' groups="account.group_account_invoice" attrs="{'invisible': ['|',('type', '=', 'out_refund'), ('state', 'not in', ('open','paid'))]}"/>
- <button name="action_invoice_cancel" type="object" states="draft,open" string="Cancel Invoice" groups="base.group_no_one"/>
<button name="action_invoice_draft" states="cancel" string="Reset to Draft" type="object" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid"/>
</header>
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index 3f7445e5c65..a493640ae80 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -1397,7 +1397,6 @@
<header>
<button name="post" states="draft" string="Post" type="object" class="oe_highlight" groups="account.group_account_invoice"/>
<button name="%(action_view_account_move_reversal)d" states="posted" string="Reverse Entry" type="action" groups="account.group_account_invoice"/>
- <button name="button_cancel" states="posted" string="Cancel Entry" type="object" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
diff --git a/addons/account_cancel/views/account_views.xml b/addons/account_cancel/views/account_views.xml
index 6eb69bdaeb7..0d3875c41b2 100644
--- a/addons/account_cancel/views/account_views.xml
+++ b/addons/account_cancel/views/account_views.xml
@@ -16,7 +16,7 @@
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
- <xpath expr="//button[@name='action_invoice_cancel']" position="replace">
+ <xpath expr="//button[@name='action_invoice_draft']" position="before">
<button name="action_invoice_cancel" type="object" states="draft,open" string="Cancel Invoice" groups="account.group_account_invoice"/>
</xpath>
</field>
@@ -27,7 +27,7 @@
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
- <xpath expr="//button[@name='action_invoice_cancel']" position="replace">
+ <xpath expr="//button[@name='action_invoice_draft']" position="before">
<button name="action_invoice_cancel" type="object" states="draft,open" string="Cancel Invoice" groups="account.group_account_invoice"/>
</xpath>
</field>
@@ -69,4 +69,16 @@
</xpath>
</field>
</record>
+
+ <record id="view_move_form_inherit_account_cancel" model="ir.ui.view">
+ <field name="name">account.move.form.inherit</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="arch" type="xml">
+ <field name="state" position="before">
+ <button name="button_cancel" states="posted" string="Cancel Entry" type="object" groups="account.group_account_invoice"/>
+ </field>
+ </field>
+ </record>
+
</odoo>