From 12f1df2b2dabd0fba5dc0e2584c9a588c378118c Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 23 Oct 2025 16:54:58 +0700 Subject: push maintenance partial delivery wizard --- indoteknik_custom/models/sale_order.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index a5e2f7c4..5c8f34c6 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -399,20 +399,21 @@ class SaleOrder(models.Model): ) def action_open_partial_delivery_wizard(self): - self.ensure_one() - pickings = self.picking_ids.filtered(lambda p: p.state not in ['done', 'cancel'] and p.name and 'BU/PICK/' in p.name) - return { - 'type': 'ir.actions.act_window', - 'name': 'Partial Delivery', - 'res_model': 'partial.delivery.wizard', - 'view_mode': 'form', - 'target': 'new', - 'context': { - 'default_sale_id': self.id, - # kasih langsung list of int biar ga ribet di wizard - 'default_picking_ids': pickings.ids, - } - } + raise UserError("Fitur ini sedang dalam pengembangan") + # self.ensure_one() + # pickings = self.picking_ids.filtered(lambda p: p.state not in ['done', 'cancel'] and p.name and 'BU/PICK/' in p.name) + # return { + # 'type': 'ir.actions.act_window', + # 'name': 'Partial Delivery', + # 'res_model': 'partial.delivery.wizard', + # 'view_mode': 'form', + # 'target': 'new', + # 'context': { + # 'default_sale_id': self.id, + # # kasih langsung list of int biar ga ribet di wizard + # 'default_picking_ids': pickings.ids, + # } + # } @api.depends('partner_id.is_cbd_locked') -- cgit v1.2.3 From 4b257da93f1eb1d025303113d6884b22df59c1b4 Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Fri, 24 Oct 2025 11:27:57 +0700 Subject: refund barang kurang --- indoteknik_custom/models/refund_sale_order.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index 47565dfc..e6547a88 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -753,10 +753,11 @@ class RefundSaleOrder(models.Model): line_vals = [] for so in self.sale_order_ids: for line in so.order_line: - if line.qty_delivered == 0: + barang_kurang = line.product_uom_qty - line.qty_delivered + if line.qty_delivered == 0 or barang_kurang > 0: line_vals.append((0, 0, { 'product_id': line.product_id.id, - 'quantity': line.product_uom_qty, + 'quantity': barang_kurang, 'from_name': so.name, 'prod_id': so.id, 'reason': '', -- cgit v1.2.3 From dc57520d3e0fe0bb8a314e1cb4ec4b3648fd8a37 Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Fri, 24 Oct 2025 11:29:00 +0700 Subject: push --- indoteknik_custom/models/refund_sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index e6547a88..475f0355 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -754,7 +754,7 @@ class RefundSaleOrder(models.Model): for so in self.sale_order_ids: for line in so.order_line: barang_kurang = line.product_uom_qty - line.qty_delivered - if line.qty_delivered == 0 or barang_kurang > 0: + if line.qty_delivered == 0 or barang_kurang >= 0: line_vals.append((0, 0, { 'product_id': line.product_id.id, 'quantity': barang_kurang, -- cgit v1.2.3 From 64fcfa3daf65c8f5699544ce73d7ec930fa124af Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Fri, 24 Oct 2025 11:35:13 +0700 Subject: push --- indoteknik_custom/models/refund_sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index 475f0355..e6547a88 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -754,7 +754,7 @@ class RefundSaleOrder(models.Model): for so in self.sale_order_ids: for line in so.order_line: barang_kurang = line.product_uom_qty - line.qty_delivered - if line.qty_delivered == 0 or barang_kurang >= 0: + if line.qty_delivered == 0 or barang_kurang > 0: line_vals.append((0, 0, { 'product_id': line.product_id.id, 'quantity': barang_kurang, -- cgit v1.2.3 From 2ee70365c70cb8de9570f456301dc85e5fc21ff7 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sat, 25 Oct 2025 09:59:50 +0700 Subject: solr log --- indoteknik_custom/models/solr/apache_solr_queue.py | 18 ++++++++++-------- indoteknik_custom/views/apache_solr_queue.xml | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index 1b51538f..ab03d569 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -1,10 +1,10 @@ from odoo import models, fields from datetime import datetime, timedelta -import logging, time - +import logging, time, traceback # <-- tambah traceback _logger = logging.getLogger(__name__) + class ApacheSolrQueue(models.Model): _name = 'apache.solr.queue' @@ -19,6 +19,7 @@ class ApacheSolrQueue(models.Model): ], 'Execute Status') execute_date = fields.Datetime('Execute Date') description = fields.Text('Description') + log = fields.Text('Log') def _compute_display_name(self): for rec in self: @@ -39,7 +40,7 @@ class ApacheSolrQueue(models.Model): if elapsed_time > max_exec_time: break rec.execute_queue() - + def open_target_record(self): return { 'name': '', @@ -70,14 +71,17 @@ class ApacheSolrQueue(models.Model): else: rec.execute_status = 'not_found' except Exception as e: - rec.description = e + # simpan error ringkas + traceback lengkap + rec.description = str(e) + rec.log = traceback.format_exc() rec.execute_status = 'failed' + rec.execute_date = datetime.utcnow() self.env.cr.commit() def create_unique(self, payload={}): count = self.search_count([ - ('res_model', '=', payload['res_model']), + ('res_model', '=', payload['res_model']), ('res_id', '=', payload['res_id']), ('function_name', '=', payload['function_name']), ('execute_status', '=', False) @@ -90,8 +94,6 @@ class ApacheSolrQueue(models.Model): ('execute_status', '=', 'success'), ('execute_date', '>=', (datetime.utcnow() - timedelta(days=days_after))), ], limit=limit) - + for rec in solr: rec.unlink() - - diff --git a/indoteknik_custom/views/apache_solr_queue.xml b/indoteknik_custom/views/apache_solr_queue.xml index 4c145b9f..d425ca72 100644 --- a/indoteknik_custom/views/apache_solr_queue.xml +++ b/indoteknik_custom/views/apache_solr_queue.xml @@ -18,6 +18,7 @@ decoration-success="execute_status == 'success'" decoration-primary="execute_status == 'not_found'" /> + -- cgit v1.2.3 From b91ff1da85f4d57770805a7f56ccb28a4d409c4d Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sat, 25 Oct 2025 10:00:47 +0700 Subject: solr log --- indoteknik_custom/models/solr/apache_solr_queue.py | 1 + 1 file changed, 1 insertion(+) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index ab03d569..3d6bd733 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -68,6 +68,7 @@ class ApacheSolrQueue(models.Model): if model_instance: getattr(model_instance, function_name)() rec.execute_status = 'success' + rec.log = traceback.format_exc() else: rec.execute_status = 'not_found' except Exception as e: -- cgit v1.2.3 From cf47d5e66cb7a87e37b17ee13df9f321dfc90f06 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sat, 25 Oct 2025 10:04:03 +0700 Subject: solr log --- indoteknik_custom/views/apache_solr_queue.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/views/apache_solr_queue.xml b/indoteknik_custom/views/apache_solr_queue.xml index d425ca72..a87d49f6 100644 --- a/indoteknik_custom/views/apache_solr_queue.xml +++ b/indoteknik_custom/views/apache_solr_queue.xml @@ -9,7 +9,7 @@ - + Date: Sat, 25 Oct 2025 12:01:36 +0700 Subject: solr image carousel and stock --- indoteknik_custom/models/solr/product_product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index d8bc3973..7260c3ca 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -69,9 +69,9 @@ class ProductProduct(models.Model): 'product_id_i': variant.id, 'template_id_i': variant.product_tmpl_id.id, 'image_s': ir_attachment.api_image('product.template', 'image_512', variant.product_tmpl_id.id), - 'image_carousel_s': [ir_attachment.api_image('image.carousel', 'image', carousel.id) for carousel in variant.product_tmpl_id.image_carousel_lines], + 'image_carousel_ss': [ir_attachment.api_image('image.carousel', 'image', carousel.id) for carousel in variant.product_tmpl_id.image_carousel_lines], 'image_mobile_s': ir_attachment.api_image('product.template', 'image_256', variant.product_tmpl_id.id), - 'stock_total_f': variant.qty_stock_vendor, + 'stock_total_f': variant.qty_free_bandengan, 'weight_f': variant.weight, 'manufacture_id_i': variant.product_tmpl_id.x_manufacture.id or 0, 'manufacture_name_s': variant.product_tmpl_id.x_manufacture.x_name or '', -- cgit v1.2.3