[FIX] sale_timesheet: visibility of the 're-invoice expenses' field on products

Before this commit:

Currently, the 'Re-Invoice Expenses' field visible when 'Can be Expensed' is
true but after the module sale_timesheet installation, it is not working.

After this commit:

The 'Re-Invoice Expenses' field visible when 'Can be Expensed' is true even
when we have a sale_timesheet module.

LINKS

PR https://github.com/odoo/odoo/pull/57259
Task-2328493

closes odoo/odoo#57856

X-original-commit: 92ef9e1198090aa51556a63f42d91282d2070c0a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
sahista pathan
2020-09-16 13:53:06 +00:00
committed by Hiral Bhavsar
parent c23fb5964f
commit dee19d96e4
+1 -2
View File
@@ -27,12 +27,11 @@ class ProductTemplate(models.Model):
return visibility or super(ProductTemplate, self)._default_visible_expense_policy()
def _compute_visible_expense_policy(self):
super(ProductTemplate, self)._compute_visible_expense_policy()
visibility = self.user_has_groups('project.group_project_user')
for product_template in self:
if not product_template.visible_expense_policy:
product_template.visible_expense_policy = visibility
return super(ProductTemplate, self)._compute_visible_expense_policy()
@api.depends('invoice_policy', 'service_type')
def _compute_service_policy(self):