diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-11-25 02:42:37 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-11-25 02:42:37 +0000 |
| commit | 4dcd1e3e1a3e4dced5a2d0d89d2fd4ee3e1fe7d3 (patch) | |
| tree | 3e15c66065c81eead3fb40c9f87e3f2c269e20f2 /indoteknik_custom/models/product_template.py | |
| parent | 2aee5a44abbe36961dfe23cc3d656aa48e11e0f9 (diff) | |
| parent | 693e78afa8b9b4df99f417392b42bff12ea41f9e (diff) | |
Merged in production (pull request #132)
Production
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index d1de2221..90e8a144 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -120,6 +120,8 @@ class ProductTemplate(models.Model): rate = 0 if product.web_price: rate += 4 + if product.qty_sold > 0: + rate += 3 if product.have_promotion_program: #have discount from pricelist rate += 5 if product.image_128: @@ -313,8 +315,9 @@ class ProductTemplate(models.Model): return values def write(self, vals): - if self.id == 224484: - raise UserError('Tidak dapat mengubah produk sementara') + for rec in self: + if rec.id == 224484: + raise UserError('Tidak dapat mengubah produk sementara') return super(ProductTemplate, self).write(vals) |
