summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Stukkens (LTU) <ltu@odoo.com>2020-12-01 15:23:48 +0100
committerXavier BOL (xbo) <xbo@odoo.com>2020-12-21 15:17:07 +0100
commit11d2da544f2991bd7db3ceccc0a2589f57af9d9b (patch)
tree1621988e66c5dc61fb122a7aa19b621a29c749f1
parenteb50424897581f1378de155b184b3045bf222d76 (diff)
[IMP] sale_timesheet: hide non_allow_billable
Remove non_allow_billable as it has been removed from project.project in PR odoo/odoo#62360. We still display the field in the form view in order to let the user unsetting this field when it is set to true. For the other way around, the user need to set the so_line to false. task-2409761
-rw-r--r--addons/sale_timesheet/views/hr_timesheet_views.xml6
-rw-r--r--addons/sale_timesheet/views/project_task_views.xml2
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/sale_timesheet/views/hr_timesheet_views.xml b/addons/sale_timesheet/views/hr_timesheet_views.xml
index 31a02c6eedb..b3f34e8db5c 100644
--- a/addons/sale_timesheet/views/hr_timesheet_views.xml
+++ b/addons/sale_timesheet/views/hr_timesheet_views.xml
@@ -10,8 +10,8 @@
<field name="timesheet_invoice_type"/>
</xpath>
<xpath expr="//filter[@name='month']" position="before">
- <filter name="billable_timesheet" string="Billable" domain="[('non_allow_billable', '=', False)]"/>
- <filter name="non_billable_timesheet" string="Non Billable" domain="[('non_allow_billable', '=', True)]"/>
+ <filter name="billable_timesheet" string="Billable" domain="[('so_line', '!=', False), ('non_allow_billable', '=', False)]"/>
+ <filter name="non_billable_timesheet" string="Non Billable" domain="['|', ('so_line', '=', False), ('non_allow_billable', '=', True)]"/>
<separator/>
<filter name="billable_time" string="Billed on Timesheets" domain="[('timesheet_invoice_type', '=', 'billable_time')]"/>
<filter name="billable_fixed" string="Billed at a Fixed Price" domain="[('timesheet_invoice_type', '=', 'billable_fixed')]"/>
@@ -42,7 +42,7 @@
<field name="inherit_id" ref="hr_timesheet.timesheet_view_tree_user"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="after">
- <field name="non_allow_billable" optional="hide"/>
+ <field name="non_allow_billable" attrs="{'invisible': [('non_allow_billable', '=', False)]}"/>
</xpath>
</field>
</record>
diff --git a/addons/sale_timesheet/views/project_task_views.xml b/addons/sale_timesheet/views/project_task_views.xml
index ec3b928291c..5f7e9ee6920 100644
--- a/addons/sale_timesheet/views/project_task_views.xml
+++ b/addons/sale_timesheet/views/project_task_views.xml
@@ -137,7 +137,7 @@
<xpath expr="//field[@name='timesheet_ids']/tree" position="inside">
<field name="timesheet_invoice_id" invisible="1"/>
<field name="so_line" readonly="1" context="{'with_remaining_hours': True}" optional="hide"/>
- <field name="non_allow_billable" attrs="{'column_invisible': ['|', '&amp;', '&amp;', '|', ('parent.bill_type', '!=', 'customer_project'), ('parent.pricing_type', '!=', 'employee_rate'), ('parent.timesheet_product_id', '=', False), ('parent.sale_line_id', '=', False), '&amp;', ('parent.bill_type', '=', 'customer_project'), ('parent.pricing_type', '=', 'employee_rate')]}" optional="hide"/>
+ <field name="non_allow_billable" attrs="{'column_invisible': ['|', '&amp;', '&amp;', '|', ('parent.bill_type', '!=', 'customer_project'), ('parent.pricing_type', '!=', 'employee_rate'), ('parent.timesheet_product_id', '=', False), ('parent.sale_line_id', '=', False), '&amp;', ('parent.bill_type', '=', 'customer_project'), ('parent.pricing_type', '=', 'employee_rate')]}" invisible="1"/>
</xpath>
</field>
</record>