summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-07-03 02:13:09 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-07-03 02:13:09 +0000
commitbe81dd2570b45de430db12ecb668f2e4df25d01b (patch)
treeefa23be9ae47d1b07ff9d45975814f8e2a6144a4
parent7be7fa7270fba7bca47a1838ef569710875960f0 (diff)
parent77c4f329788de87938c971de525b9717844978b8 (diff)
Merged in feature/iman_sequence (pull request #153)
<iman> add sequence to program promotion line
-rw-r--r--indoteknik_custom/models/promotion/promotion_program_line.py1
-rw-r--r--indoteknik_custom/models/solr/promotion_program_line.py2
-rw-r--r--indoteknik_custom/views/promotion/promotion_program_line.xml1
3 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_custom/models/promotion/promotion_program_line.py b/indoteknik_custom/models/promotion/promotion_program_line.py
index 34b70ca5..d253c68d 100644
--- a/indoteknik_custom/models/promotion/promotion_program_line.py
+++ b/indoteknik_custom/models/promotion/promotion_program_line.py
@@ -23,6 +23,7 @@ class PromotionProgramLine(models.Model):
display_on_homepage = fields.Boolean('Display on Homepage')
price = fields.Float('Price')
+ sequence = fields.Integer(string='Sequence', default=0)
discount_type = fields.Selection([
("percentage", "Percentage"),
("fixed", "Fixed")
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py
index 36aea1ed..8f62ecc0 100644
--- a/indoteknik_custom/models/solr/promotion_program_line.py
+++ b/indoteknik_custom/models/solr/promotion_program_line.py
@@ -3,7 +3,6 @@ from typing import Type
import pysolr
import json
-
class PromotionProgramLine(models.Model):
_inherit = 'promotion.program.line'
_solr_schema = 'promotion_program_lines'
@@ -47,6 +46,7 @@ class PromotionProgramLine(models.Model):
'package_limit_user_i': rec.package_limit_user,
'package_limit_trx_i': rec.package_limit_trx,
'price_f': rec.price,
+ 'sequence_i': rec.sequence,
'product_ids': [x.product_id.id for x in rec.product_ids],
'products_s': json.dumps(products),
'free_product_ids': [x.product_id.id for x in rec.free_product_ids],
diff --git a/indoteknik_custom/views/promotion/promotion_program_line.xml b/indoteknik_custom/views/promotion/promotion_program_line.xml
index 3f077a13..f3c2eea1 100644
--- a/indoteknik_custom/views/promotion/promotion_program_line.xml
+++ b/indoteknik_custom/views/promotion/promotion_program_line.xml
@@ -32,6 +32,7 @@
<field name="package_limit_user" />
<field name="package_limit_trx" />
<field name="price" attrs="{'invisible': [('promotion_type', '=', 'special_price')]}" />
+ <field name="sequence"/>
<field name="discount_type" attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}" />
<field name="discount_amount" attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}" />
</group>