diff options
| -rwxr-xr-x | fixco_custom/models/product_product.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fixco_custom/models/product_product.py b/fixco_custom/models/product_product.py index b0ad7b9..6c92fba 100755 --- a/fixco_custom/models/product_product.py +++ b/fixco_custom/models/product_product.py @@ -25,6 +25,16 @@ class ProductProduct(models.Model): default_code = fields.Char(required=True) taxed_id = fields.Many2many('taxes', string='Taxes', required=True) + def create(self, vals): + allowed_user_ids = [2, 10, 12, 15] + + if self.env.user.id not in allowed_user_ids: + raise UserError( + _("Anda tidak memiliki hak untuk membuat produk baru.") + ) + + return super(ProductProduct, self).create(vals) + def action_open_pricelist_wizard(self): return { 'name': 'Create Purchase Pricelist', |
