summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-05-27 10:57:24 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-05-27 10:57:24 +0700
commit755f6efe380cbbdd05ba592f651ca87030a22143 (patch)
tree96734fa0ad5a9c18f162f9e8a2c087e4398176eb
parent8a7315b6e8ba391f1260bc994df00107d52623c3 (diff)
fix api shipment group
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
-rw-r--r--indoteknik_custom/models/shipment_group.py10
-rw-r--r--indoteknik_custom/models/stock_picking.py4
3 files changed, 10 insertions, 8 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 36c4c7b9..2513f8fd 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -849,8 +849,8 @@ class PurchaseOrder(models.Model):
)
if not self.from_apo:
- if not self.matches_so and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
- raise UserError("Tidak ada link dengan SO, harus approval Merchandise")
+ if not self.matches_so and not self.env.user.id == 21:
+ raise UserError("Tidak ada link dengan SO, harus approval Rafly")
send_email = False
if not self.not_update_purchasepricelist:
diff --git a/indoteknik_custom/models/shipment_group.py b/indoteknik_custom/models/shipment_group.py
index 2d84d54c..ea91238a 100644
--- a/indoteknik_custom/models/shipment_group.py
+++ b/indoteknik_custom/models/shipment_group.py
@@ -19,11 +19,13 @@ class ShipmentGroup(models.Model):
def sync_api_shipping(self):
for rec in self.shipment_line:
+ picking_names = [picking.name for picking in rec.picking_id]
if rec.shipment_id.carrier_id.id == 173:
- rec.picking_id.action_get_kgx_pod()
-
- if rec.shipment_id.carrier_id.id == 151:
- rec.picking_id.track_envio_shipment()
+ rec.picking_id.action_get_kgx_pod(
+ shipment=f"{self.number},{','.join(picking_names)}"
+ )
+ elif rec.shipment_id.carrier_id.id == 151:
+ rec.picking_id.track_envio_shipment()
@api.depends('shipment_line.total_colly')
def _compute_total_colly_line(self):
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 887b2f92..3223377c 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -310,10 +310,10 @@ class StockPicking(models.Model):
except ValueError:
return False
- def action_get_kgx_pod(self):
+ def action_get_kgx_pod(self, shipment=False):
self.ensure_one()
- awb_number = self._get_kgx_awb_number()
+ awb_number = shipment or self._get_kgx_awb_number()
if not awb_number:
raise UserError("Nomor AWB tidak dapat dibuat, pastikan picking memiliki name dan origin")