diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 19bcc780..55a9288f 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -333,6 +333,12 @@ class ProductProduct(models.Model): is_edited = fields.Boolean(string='Is Edited') qty_sold = fields.Float(string='Sold Quantity', compute='_get_qty_sold') + def write(self, vals): + if self.id in [385544, 224484]: + raise UserError('Tidak dapat mengubah produk sementara') + + return super(ProductProduct, self).write(vals) + def _get_qty_upcoming(self): for product in self: product.qty_upcoming = product.incoming_qty + product.qty_available |
