diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-17 16:08:01 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-17 16:08:01 +0700 |
| commit | ff9f2f59d1042acaea778049333f1db114a431cb (patch) | |
| tree | c8873b2717cb79cc7baf3770ee782a6f60ef07ae | |
| parent | 955301fbaf26f847c72e7f0f9f4b8ab47708c906 (diff) | |
Update ignore write temporary product validation
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 12 |
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 |
