summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-04-30 10:15:35 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-04-30 10:15:35 +0700
commit475173ec46981926aa90e99f796e38ef1d46b61e (patch)
tree7a60d68b1dc779ecd031187eaadfed0c94de597d
parent840bc3f8c04933a56a31c279ef6e220c277bd36d (diff)
sequence pricelist and fix bug validation invoice date and date doc kirim
-rw-r--r--indoteknik_api/models/product_pricelist.py3
-rw-r--r--indoteknik_custom/models/product_pricelist.py1
-rw-r--r--indoteknik_custom/models/stock_picking.py2
-rw-r--r--indoteknik_custom/views/product_pricelist.xml1
4 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py
index 3ba38940..e0debf38 100644
--- a/indoteknik_api/models/product_pricelist.py
+++ b/indoteknik_api/models/product_pricelist.py
@@ -106,14 +106,13 @@ class ProductPricelist(models.Model):
else:
is_show_program = False
-
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
pricelist = self.search([
('is_flash_sale', '=', True),
('is_show_program', '=', is_show_program),
('start_date', '<=', current_time),
('end_date', '>=', current_time)
- ], order='start_date asc')
+ ], order='number asc')
return pricelist
def is_flash_sale_product(self, product_id: int):
diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py
index c299ff2f..ea3ee6cf 100644
--- a/indoteknik_custom/models/product_pricelist.py
+++ b/indoteknik_custom/models/product_pricelist.py
@@ -17,6 +17,7 @@ class ProductPricelist(models.Model):
], string='Flash Sale Option')
banner_top = fields.Binary(string='Banner Top')
flashsale_tag = fields.Char(string='Flash Sale Tag')
+ number = fields.Integer(string='Sequence')
def _check_end_date_and_update_solr(self):
today = datetime.utcnow().date()
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index d2b1b9f2..0b688fab 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1187,7 +1187,7 @@ class StockPicking(models.Model):
if picking.picking_type_code != 'outgoing' or 'BU/OUT/' not in picking.name or picking.partner_id.id == 96868:
continue
- invoice = self.env['account.move'].search([('sale_id', '=', picking.sale_id.id)], limit=1)
+ invoice = self.env['account.move'].search([('sale_id', '=', picking.sale_id.id), ('state','not in',['draft','cancel'])], limit=1)
if not invoice:
continue
diff --git a/indoteknik_custom/views/product_pricelist.xml b/indoteknik_custom/views/product_pricelist.xml
index 6eff0153..3c2b8b8d 100644
--- a/indoteknik_custom/views/product_pricelist.xml
+++ b/indoteknik_custom/views/product_pricelist.xml
@@ -20,6 +20,7 @@
<field name="banner_top" widget="image" />
<field name="start_date" attrs="{'required': [('is_flash_sale', '=', True)]}" />
<field name="end_date" attrs="{'required': [('is_flash_sale', '=', True)]}" />
+ <field name="number" required="1" />
</group>
</group>
</page>