summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-06-12 08:22:10 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-06-12 08:22:10 +0700
commit1f2995a85428ac4335123bd33d48ae17d3c9f36f (patch)
tree42d8558ac317fcb3b158b52fe01205c35b885c64 /indoteknik_custom
parentdb7481a490b87e3a1768112395bf096b93969562 (diff)
Update promotion program feature
Diffstat (limited to 'indoteknik_custom')
-rw-r--r--indoteknik_custom/models/ir_attachment.py5
-rw-r--r--indoteknik_custom/models/promotion_program_line.py2
-rw-r--r--indoteknik_custom/views/promotion_program_line.xml6
3 files changed, 9 insertions, 4 deletions
diff --git a/indoteknik_custom/models/ir_attachment.py b/indoteknik_custom/models/ir_attachment.py
index fd86ab1b..6417fa3f 100644
--- a/indoteknik_custom/models/ir_attachment.py
+++ b/indoteknik_custom/models/ir_attachment.py
@@ -22,4 +22,9 @@ class Attachment(models.Model):
def api_image(self, model, field, id):
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
is_found = self.is_found(model, field, id)
+ return base_url + 'api/image/' + model + '/' + field + '/' + str(id) if is_found else ''
+
+ def api_image_local(self, model, field, id):
+ base_url = self.env['ir.config_parameter'].get_param('web.base.local_url')
+ is_found = self.is_found(model, field, id)
return base_url + 'api/image/' + model + '/' + field + '/' + str(id) if is_found else '' \ No newline at end of file
diff --git a/indoteknik_custom/models/promotion_program_line.py b/indoteknik_custom/models/promotion_program_line.py
index a8ee2c43..b6c9a532 100644
--- a/indoteknik_custom/models/promotion_program_line.py
+++ b/indoteknik_custom/models/promotion_program_line.py
@@ -16,7 +16,7 @@ class PromotionProgramLine(models.Model):
], string="Discount Type")
discount_amount = fields.Float(string="Discount Amount")
promotion_type = fields.Selection(selection=[
- ("specific_product", "Specific Product"),
+ ("special_price", "Special Price"),
("bundling", "Bundling"),
("discount_loading", "Discount Loading"),
("merchandise", "Merchandise")
diff --git a/indoteknik_custom/views/promotion_program_line.xml b/indoteknik_custom/views/promotion_program_line.xml
index bb625a8f..e15bb0d7 100644
--- a/indoteknik_custom/views/promotion_program_line.xml
+++ b/indoteknik_custom/views/promotion_program_line.xml
@@ -34,11 +34,11 @@
<field name="limit_qty_transaction" />
<field
name="discount_type"
- attrs="{'invisible': [('promotion_type', '!=', 'specific_product')]}"
+ attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
/>
<field
name="discount_amount"
- attrs="{'invisible': [('promotion_type', '!=', 'specific_product')]}"
+ attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
/>
<field
name="minimum_purchase_qty"
@@ -50,7 +50,7 @@
/>
<field
name="display_on_homepage"
- attrs="{'invisible': [('promotion_type', '!=', 'specific_product')]}"
+ attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
/>
</group>
</group>