From 20ab2011bc9766e436cf3f81be70c1c52af824ba Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 2 Feb 2026 15:22:49 +0700 Subject: push --- fixco_custom/models/product_product.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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', -- cgit v1.2.3