diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-05-28 09:00:30 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-05-28 09:00:30 +0700 |
| commit | 4ed94e9e1de027aba326ff3dce954b765f752009 (patch) | |
| tree | dadad3fa60640737fe0128019e7fdbc67f236553 | |
| parent | 85f9481cce4fbec278d2cde48f009d480b8a35ed (diff) | |
(andri) penambahan log note ketika biteship berhasil & penyesuaian field required pada SO
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 11 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index e5297011..f2bb27ad 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -652,8 +652,8 @@ class SaleOrder(models.Model): product_names = '<br/>'.join(missing_weight_products) self.message_post(body=f"Produk berikut tidak memiliki berat:<br/>{product_names}") - # if total_weight == 0: - # raise UserError("Tidak dapat mengestimasi ongkir tanpa berat yang valid.") + if total_weight == 0: + raise UserError("Tidak dapat mengestimasi ongkir tanpa karena berat produk = 0 kg.") # Validasi alamat pengiriman if not self.real_shipping_id: @@ -674,8 +674,8 @@ class SaleOrder(models.Model): total_weight = self._validate_for_shipping_estimate() weight_gram = int(total_weight * 1000) - if weight_gram < 100: - weight_gram = 100 + # if weight_gram < 100: + # weight_gram = 100 items = [{ "name": "Paket Pesanan", @@ -683,9 +683,6 @@ class SaleOrder(models.Model): "value": int(self.amount_untaxed), "weight": weight_gram, "quantity": 1, - "height": 10, - "width": 10, - "length": 10 }] shipping_address = self.real_shipping_id diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 5548db75..4522dac0 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -617,6 +617,14 @@ class StockPicking(models.Model): waybill_id = data.get("courier", {}).get("waybill_id", "") + self.message_post( + body=f"📦 Biteship berhasil dilakukan.<br/>" + f"Kurir: {self.carrier_id.name}<br/>" + f"Tracking ID: {self.biteship_tracking_id or '-'}<br/>" + f"Resi: {waybill_id or '-'}", + message_type="comment" + ) + message = f"✅ Berhasil Order ke Biteship! Resi: {waybill_id}" if waybill_id else "⚠️ Order berhasil, tetapi tidak ada nomor resi." return { diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 7e01ba0b..c00d68a1 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -118,7 +118,7 @@ <field name="approval_status" /> <field name="sales_tax_id" domain="[('type_tax_use','=','sale'), ('active', '=', True)]" required="1" /> - <field name="select_shipping_option"/> + <field name="select_shipping_option" required="1"/> <field name="carrier_id" required="1" domain="[]" /> <field name="delivery_service_type" readonly="1" /> <field name="shipping_option_id" /> |
