summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpr-odoo <jpr@openerp.com>2018-02-09 06:48:26 +0100
committerYannick Tivisse <yti@odoo.com>2018-02-09 07:31:38 +0100
commitcfef0ad48019483b38df8469068d8527b4911087 (patch)
tree05826ce2e02a470d721e48c60904f5298485c53a
parentba892f78110ca3cdb845b3207107c11b969df90a (diff)
[IMP] expense: Highlight 'Submit to Manager' when there's an attachment
Purpose ======= Only highlight the button when there's an attachment on the expense.
-rw-r--r--addons/hr_expense/views/hr_expense_views.xml3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/hr_expense/views/hr_expense_views.xml b/addons/hr_expense/views/hr_expense_views.xml
index c1a0180c081..a9c0f4c77e6 100644
--- a/addons/hr_expense/views/hr_expense_views.xml
+++ b/addons/hr_expense/views/hr_expense_views.xml
@@ -98,9 +98,10 @@
<field name="arch" type="xml">
<xpath expr="/form/*" position="before">
<header>
- <button name="action_submit_expenses" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
<widget name="attach_document" string="Attach Document" action="message_post" attrs="{'invisible': [('attachment_number', '&lt;=', 0)]}"/>
<widget name="attach_document" string="Attach Document" action="message_post" class="oe_highlight" attrs="{'invisible': [('attachment_number', '&gt;=', 1)]}"/>
+ <button name="action_submit_expenses" string="Submit to Manager" type="object" class="o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '&gt;=', 1), ('sheet_id', '!=', False)]}"/>
+ <button name="action_submit_expenses" string="Submit to Manager" type="object" class="oe_highlight o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '&lt;=', 0), ('sheet_id', '!=', False)]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,reported,approved,done,refused"/>
<button name="action_view_sheet" type="object" string="View Report" class="oe_highlight" attrs="{'invisible': [('state', '=','draft')]}"/>
</header>