From bbc1f241fb12e8a1115fdbc90ab5846bcfd47ee3 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Wed, 13 Aug 2025 08:34:12 +0700 Subject: Remove duplicate return --- indoteknik_custom/models/tukar_guling.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index ff641f34..4b03d4b0 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -380,10 +380,6 @@ class TukarGuling(models.Model): res.message_post(body=_("CCM Created By %s") % self.env.user.name) return res - res = super(TukarGuling, self).create(vals) - res.message_post(body=_("CCM Created By %s") % self.env.user.name) - return res - def copy(self, default=None): if default is None: default = {} -- cgit v1.2.3 From db75081a2afcd369e8a0169f3fe2f080dbad0c4a Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 14 Aug 2025 10:46:06 +0700 Subject: Change or edit address website --- indoteknik_api/controllers/api_v1/partner.py | 4 ++-- indoteknik_custom/models/res_partner.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indoteknik_api/controllers/api_v1/partner.py b/indoteknik_api/controllers/api_v1/partner.py index 14136ca3..acec19f7 100644 --- a/indoteknik_api/controllers/api_v1/partner.py +++ b/indoteknik_api/controllers/api_v1/partner.py @@ -150,7 +150,7 @@ class Partner(controller.Controller): partner_params = self.get_request_params(request_data, { 'tax_name': ['alias:nama_wajib_pajak'], - # 'company_type_id': ['number'], + 'company_type_id': [''], 'industry_id': ['number'], 'npwp': [], 'alamat_lengkap_text': [], @@ -170,7 +170,7 @@ class Partner(controller.Controller): if 'id_user' in request_data: user_params = self.get_request_params(request_data, { 'id_user': ['required', 'number'], - # 'company_type_id': ['number'], + 'company_type_id': [''], 'industry_id': ['number'], 'tax_name': ['alias:nama_wajib_pajak'], 'npwp': [], diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index f260f58e..cf9fbea4 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -231,7 +231,7 @@ class ResPartner(models.Model): rec.payment_difficulty = rec.parent_id.payment_difficulty return records - @api.constrains('name') + @api.constrains('email') def _check_duplicate_name(self): for record in self: if record.name: @@ -242,7 +242,7 @@ class ResPartner(models.Model): ], limit=1) if existing_partner: - raise ValidationError(f"Nama '{record.name}' sudah digunakan oleh partner lain!") + raise ValidationError(f"Nama '{record.name}' dengan email '{record.email}' sudah digunakan oleh partner lain!") @api.constrains('npwp') def _check_npwp(self): -- cgit v1.2.3 From ad6ccce331dc8c83f2cacb82b0e3c94467ff9d85 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 14 Aug 2025 16:26:22 +0700 Subject: fix bug --- indoteknik_custom/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 82f81642..0354587c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1060,7 +1060,7 @@ class StockPicking(models.Model): self.sale_id.date_doc_kirim = self.date_doc_kirim def action_assign(self): - if self.env.context.get('default_picking_type_id'): + if self.env.context.get('default_picking_type_id') and self.sale_id: pickings_to_assign = self.filtered( lambda p: not (p.sale_id and p.sale_id.hold_outgoing) ) -- cgit v1.2.3 From b87ad37ce3f5ba0f3fb0f7613755fd000ffed8fa Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 14 Aug 2025 18:12:35 +0700 Subject: doesnt allow user create from tree --- indoteknik_custom/views/tukar_guling_po.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/views/tukar_guling_po.xml b/indoteknik_custom/views/tukar_guling_po.xml index 1c6a86ea..548a209f 100644 --- a/indoteknik_custom/views/tukar_guling_po.xml +++ b/indoteknik_custom/views/tukar_guling_po.xml @@ -21,7 +21,7 @@ pengajuan.tukar.guling.po.tree tukar.guling.po - + -- cgit v1.2.3 From 4e1d5fa01a64bc6daa6c7bf7255caa55ccf53c59 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 14 Aug 2025 18:28:26 +0700 Subject: Vals already returned --- indoteknik_custom/models/tukar_guling_po.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py index cc1c79c0..94771f37 100644 --- a/indoteknik_custom/models/tukar_guling_po.py +++ b/indoteknik_custom/models/tukar_guling_po.py @@ -435,6 +435,15 @@ class TukarGulingPO(models.Model): if bu_put: raise UserError("❌ Tidak bisa retur BU/INPUT karena BU/PUT sudah Done!") + existing_tukar_guling = self.env['tukar.guling.po'].search([ + ('operations', '=', self.operations.id), + ('id', '!=', self.id), + ('state', '!=', 'cancel'), + ], limit=1) + + if existing_tukar_guling: + raise UserError("BU ini sudah pernah diretur oleh dokumen %s." % existing_tukar_guling.name) + picking = self.operations pick_id = self.operations.picking_type_id.id if pick_id == 75: -- cgit v1.2.3 From aef7941fa025879bfa47ad626c0de7cb716e2ccc Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 15 Aug 2025 09:08:22 +0700 Subject: fix bug --- indoteknik_custom/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index bf6834d0..d63c5d4c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1060,7 +1060,7 @@ class StockPicking(models.Model): self.sale_id.date_doc_kirim = self.date_doc_kirim def action_assign(self): - if self.env.context.get('default_picking_type_id') and self.sale_id: + if self.env.context.get('default_picking_type_id') and ('BU/INPUT' not in self.name or 'BU/PUT' not in self.name): pickings_to_assign = self.filtered( lambda p: not (p.sale_id and p.sale_id.hold_outgoing) ) -- cgit v1.2.3 From 8dd70f877c68abb3f0331e18f4652acb11e1bf84 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 15 Aug 2025 10:42:48 +0700 Subject: partial check product bom --- indoteknik_custom/models/mrp_production.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py index 91da0597..b39995b5 100644 --- a/indoteknik_custom/models/mrp_production.py +++ b/indoteknik_custom/models/mrp_production.py @@ -263,7 +263,7 @@ class CheckBomProduct(models.Model): "The product '%s' tidak ada di operations. " ) % record.product_id.display_name) - total_qty_in_moves = sum(moves.mapped('product_uom_qty')) + total_qty_in_moves = sum(moves.mapped('quantity_done')) # Find existing lines for the same product, excluding the current line existing_lines = record.production_id.check_bom_product_lines.filtered( @@ -273,15 +273,15 @@ class CheckBomProduct(models.Model): if existing_lines: total_quantity = sum(existing_lines.mapped('quantity')) - if total_quantity > total_qty_in_moves: + if total_quantity != total_qty_in_moves: raise UserError(( - "Quantity Product '%s' kurang dari quantity demand." + "Quantity Product '%s' harus sama dengan quantity consumed." ) % (record.product_id.display_name)) else: # Check if the quantity exceeds the allowed total - if record.quantity > total_qty_in_moves: + if record.quantity != total_qty_in_moves: raise UserError(( - "Quantity Product '%s' kurang dari quantity demand." + "Quantity Product '%s' harus sama dengan quantity consumed." ) % (record.product_id.display_name)) # Set the quantity to the entered value @@ -446,7 +446,7 @@ class CheckBomProduct(models.Model): "The product '%s' tidak ada di operations. " ) % record.product_id.display_name) - total_qty_in_moves = sum(moves.mapped('product_uom_qty')) + total_qty_in_moves = sum(moves.mapped('quantity_done')) # Find existing lines for the same product, excluding the current line existing_lines = record.production_id.check_bom_product_lines.filtered( @@ -462,13 +462,13 @@ class CheckBomProduct(models.Model): if total_quantity > total_qty_in_moves: raise UserError(( - "Quantity Product '%s' sudah melebihi quantity demand." + "Quantity Product '%s' sudah melebihi quantity consumed." ) % (record.product_id.display_name)) else: # Check if the quantity exceeds the allowed total if record.quantity == total_qty_in_moves: raise UserError(( - "Quantity Product '%s' sudah melebihi quantity demand." + "Quantity Product '%s' sudah melebihi quantity consumed." ) % (record.product_id.display_name)) # Set the quantity to the entered value -- cgit v1.2.3