summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/product_template.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 55a9288f..10d109fb 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -307,6 +307,12 @@ class ProductTemplate(models.Model):
}
self.env['token.storage'].create([values])
return values
+
+ def write(self, vals):
+ if self.id == 224484:
+ raise UserError('Tidak dapat mengubah produk sementara')
+
+ return super(ProductTemplate, self).write(vals)
class ProductProduct(models.Model):
_inherit = "product.product"
@@ -333,12 +339,6 @@ 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