summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-12 15:36:24 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-12 15:36:24 +0700
commit17fd1072ccd6f2f74f73dd2e52ce7f0120adb3ce (patch)
tree9ec23101dbc979a3b295d2ea9c7306e224b7b921
parent5a349860e2da496e311b98e2075c783b8bbc0a14 (diff)
add is_show_program on flash sale
-rw-r--r--indoteknik_api/controllers/api_v1/flash_sale.py1
-rw-r--r--indoteknik_custom/models/product_pricelist.py1
-rw-r--r--indoteknik_custom/views/product_pricelist.xml1
3 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/flash_sale.py b/indoteknik_api/controllers/api_v1/flash_sale.py
index dff8bec3..05636704 100644
--- a/indoteknik_api/controllers/api_v1/flash_sale.py
+++ b/indoteknik_api/controllers/api_v1/flash_sale.py
@@ -24,6 +24,7 @@ class FlashSale(controller.Controller):
'pricelist_id': pricelist.id,
'option': pricelist.flashsale_option,
'name': pricelist.name,
+ 'is_show_program': pricelist.is_show_program,
'banner': request.env['ir.attachment'].api_image('product.pricelist', 'banner', pricelist.id),
'banner_mobile': request.env['ir.attachment'].api_image('product.pricelist', 'banner_mobile', pricelist.id),
'banner_top': request.env['ir.attachment'].api_image('product.pricelist', 'banner_top', pricelist.id),
diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py
index b7a6d77e..2b17cf6e 100644
--- a/indoteknik_custom/models/product_pricelist.py
+++ b/indoteknik_custom/models/product_pricelist.py
@@ -6,6 +6,7 @@ class ProductPricelist(models.Model):
_inherit = 'product.pricelist'
is_flash_sale = fields.Boolean(string='Flash Sale', default=False)
+ is_show_program = fields.Boolean(string='Show Program', default=False)
banner = fields.Binary(string='Banner')
start_date = fields.Datetime(string='Start Date')
end_date = fields.Datetime(string='End Date')
diff --git a/indoteknik_custom/views/product_pricelist.xml b/indoteknik_custom/views/product_pricelist.xml
index 55139a24..0dfb69db 100644
--- a/indoteknik_custom/views/product_pricelist.xml
+++ b/indoteknik_custom/views/product_pricelist.xml
@@ -7,6 +7,7 @@
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="is_flash_sale"/>
+ <field name="is_show_program" attrs="{'invisible': [('is_flash_sale', '=', False)]}"/>
</field>
<page name="pricelist_rules" position="before">
<page name="flash_sale_setting" string="Flash Sale" attrs="{'invisible': [('is_flash_sale', '=', False)]}">