summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/product_template.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
-rwxr-xr-xindoteknik_custom/models/product_template.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 82cb0432..72fb4dea 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -319,4 +319,11 @@ class ProductProduct(models.Model):
def unlink(self):
if self._name == 'product.product':
- raise UserError('Maaf anda tidak bisa delete product') \ No newline at end of file
+ raise UserError('Maaf anda tidak bisa delete product')
+
+ def _get_active_flash_sale(self):
+ pricelist = self.env['product.pricelist'].search([
+ ('is_flash_sale', '=', True),
+ ('item_ids.product_id', '=', self.id)
+ ], limit=1)
+ return pricelist \ No newline at end of file