From a2953c59a7d868e1c1d6d217757fde598ee34652 Mon Sep 17 00:00:00 2001 From: Jorge Che Date: Fri, 7 Oct 2022 23:59:56 +0000 Subject: [PATCH] [FIX] hr_commission: refactor readonly logic for no_commission field H11044 --- hr_commission/models/product_template.py | 6 ------ hr_commission/views/product_views.xml | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hr_commission/models/product_template.py b/hr_commission/models/product_template.py index 9a8ca77e..6278552b 100644 --- a/hr_commission/models/product_template.py +++ b/hr_commission/models/product_template.py @@ -5,9 +5,3 @@ class ProductTemplate(models.Model): _inherit = 'product.template' no_commission = fields.Boolean('Exclude from Commissions') - can_edit_no_commission = fields.Boolean(compute='_compute_can_edit_no_commission') - - def _compute_can_edit_no_commission(self): - can_edit = self.env.user.has_group('account.group_account_user') - for template in self: - template.can_edit_no_commission = can_edit diff --git a/hr_commission/views/product_views.xml b/hr_commission/views/product_views.xml index 656f8f0f..7839df65 100644 --- a/hr_commission/views/product_views.xml +++ b/hr_commission/views/product_views.xml @@ -7,11 +7,22 @@ - - - + + + + + + + product.template.common.form.inherit.manager + product.template + + + + + 0