diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-01 11:32:11 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-01 11:32:11 +0700 |
| commit | f8e0259289c728b11a373601e569f6e64ca803f8 (patch) | |
| tree | 6a97c8c8d735230bdcf5026af0847a94efb27293 /indoteknik_custom/models/product_template.py | |
| parent | f785e7605f4d0151a0f48e3d871b996c40e51351 (diff) | |
Update voucher can't combined with other promotions
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 0b9b1945..e07adf30 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -327,4 +327,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 |
