From 502d44ac6ecc8bbeeea35a205f326d0c56980934 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 5 Mar 2025 14:43:09 +0700 Subject: update code --- indoteknik_api/models/res_partner.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indoteknik_api/models') diff --git a/indoteknik_api/models/res_partner.py b/indoteknik_api/models/res_partner.py index 0e09fbc6..3a98f3bc 100644 --- a/indoteknik_api/models/res_partner.py +++ b/indoteknik_api/models/res_partner.py @@ -59,6 +59,7 @@ class ResPartner(models.Model): # Pengiriman 'PIC_tittle' : pengajuan_tempo.pic_tittle if pengajuan_tempo.pic_tittle else '', + 'PICBarangMobile' : pengajuan_tempo.pic_mobile if pengajuan_tempo.pic_mobile else '', 'PIC_name' : pengajuan_tempo.pic_name if pengajuan_tempo.pic_name else '', 'street_pengiriman' : pengajuan_tempo.street_pengiriman if pengajuan_tempo.street_pengiriman else '', 'state_pengiriman' : pengajuan_tempo.state_id_pengiriman.id if pengajuan_tempo.state_id_pengiriman else '', @@ -67,6 +68,7 @@ class ResPartner(models.Model): 'subDistrict_pengiriman': pengajuan_tempo.subDistrict_id_pengiriman.id if pengajuan_tempo.subDistrict_id_pengiriman else '', 'zip_pengiriman' : pengajuan_tempo.zip_pengiriman if pengajuan_tempo.zip_pengiriman else '', 'invoice_pic_tittle' : pengajuan_tempo.invoice_pic_tittle if pengajuan_tempo.invoice_pic_tittle else '', + 'invoice_pic_mobile' : pengajuan_tempo.invoice_pic_mobile if pengajuan_tempo.invoice_pic_mobile else '', 'invoice_pic' : pengajuan_tempo.invoice_pic if pengajuan_tempo.invoice_pic else '', 'street_invoice' : pengajuan_tempo.street_invoice if pengajuan_tempo.street_invoice else '', 'state_invoice' : pengajuan_tempo.state_id_invoice.id if pengajuan_tempo.state_id_invoice else '', @@ -82,6 +84,12 @@ class ResPartner(models.Model): 'dokumen_pengiriman_invoice' : pengajuan_tempo.dokumen_invoice if pengajuan_tempo.dokumen_invoice else '', 'is_same_addrees': pengajuan_tempo.is_same_address if pengajuan_tempo.is_same_address else False, 'is_same_addrees_street': pengajuan_tempo.is_same_address_street if pengajuan_tempo.is_same_address_street else False, + 'dokumen_prosedur': + { + 'name': pengajuan_tempo.dokumen_prosedur.name, + 'base64': pengajuan_tempo.dokumen_prosedur.datas.decode('utf-8'), + 'format': pengajuan_tempo.dokumen_prosedur.mimetype, + } if pengajuan_tempo.dokumen_prosedur else '', 'supplier_ids': [ { 'id': supplier.id, -- cgit v1.2.3 From 783b674e04dd123a5233fd01896925c73aa8143c Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 29 Apr 2025 10:00:15 +0700 Subject: check product on bom, view stock picking po and fix bug api flashsale header --- indoteknik_api/models/product_pricelist.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indoteknik_api/models') diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py index 6e88517c..2e825740 100644 --- a/indoteknik_api/models/product_pricelist.py +++ b/indoteknik_api/models/product_pricelist.py @@ -95,15 +95,20 @@ class ProductPricelist(models.Model): ], limit=1, order='start_date asc') return pricelist - def get_is_show_program_flash_sale(self): + def get_is_show_program_flash_sale(self, is_show_program): """ Check whether have active flash sale in range of date @return: returns pricelist: object """ + + if is_show_program == 'true': + is_show_program = True + 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', '=', True), + ('is_show_program', '=', is_show_program), ('start_date', '<=', current_time), ('end_date', '>=', current_time) ], order='start_date asc') -- cgit v1.2.3 From 47e59c2ec810bb6e77180ea4e9896f9c98f246fc Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 29 Apr 2025 10:22:25 +0700 Subject: push --- indoteknik_api/models/product_pricelist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indoteknik_api/models') diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py index 2e825740..744faaee 100644 --- a/indoteknik_api/models/product_pricelist.py +++ b/indoteknik_api/models/product_pricelist.py @@ -105,10 +105,12 @@ class ProductPricelist(models.Model): is_show_program = True 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), + ('is_show_program', '=', True), ('start_date', '<=', current_time), ('end_date', '>=', current_time) ], order='start_date asc') -- cgit v1.2.3 From 840bc3f8c04933a56a31c279ef6e220c277bd36d Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 29 Apr 2025 14:54:41 +0700 Subject: push --- indoteknik_api/models/product_pricelist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_api/models') diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py index 744faaee..3ba38940 100644 --- a/indoteknik_api/models/product_pricelist.py +++ b/indoteknik_api/models/product_pricelist.py @@ -106,11 +106,11 @@ 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', '=', True), + ('is_show_program', '=', is_show_program), ('start_date', '<=', current_time), ('end_date', '>=', current_time) ], order='start_date asc') -- cgit v1.2.3 From 475173ec46981926aa90e99f796e38ef1d46b61e Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 30 Apr 2025 10:15:35 +0700 Subject: sequence pricelist and fix bug validation invoice date and date doc kirim --- indoteknik_api/models/product_pricelist.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indoteknik_api/models') 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): -- cgit v1.2.3