summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-11-08 08:46:52 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-11-08 08:46:52 +0700
commit4f4bcf8ba7aa3f3f1b688997d9ec8b8cd913dad3 (patch)
tree489347db2b71d7b1ea627bb89b831aa83705488e
parentf6afdd8f02676e9f0f16e2363f0065982e1e0c54 (diff)
parent8d4ba8a22aa90a7c2dfad48c5de38ee17b68db60 (diff)
Merge branch 'production' into CR/quotation-noPo
-rwxr-xr-xindoteknik_custom/models/purchase_order.py12
-rw-r--r--indoteknik_custom/models/stock_picking.py6
2 files changed, 10 insertions, 8 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 6fc0c497..ef86bc61 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -595,7 +595,7 @@ class PurchaseOrder(models.Model):
if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
raise UserError("Beda Margin dengan Sales, harus approval Merchandise")
if not self.from_apo:
- if not self.sale_order_id and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
+ 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")
send_email = False
@@ -727,7 +727,7 @@ class PurchaseOrder(models.Model):
raise UserError("Hanya Merchandiser yang bisa approve")
if self.env.user.is_leader or self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
raise UserError("Bisa langsung Confirm")
- elif self.total_percent_margin == self.total_so_percent_margin and self.sale_order_id:
+ elif self.total_percent_margin == self.total_so_percent_margin and self.matches_so:
raise UserError("Bisa langsung Confirm")
else:
reason = ''
@@ -736,12 +736,14 @@ class PurchaseOrder(models.Model):
reason = 'above 50jt, '
if self.total_percent_margin < self.total_so_percent_margin:
reason += 'diff margin, '
- if not self.from_apo and not self.sale_order_id:
- reason += 'not link with sales, '
+ if not self.from_apo and not self.matches_so:
+ reason += 'not link with pj and reorder, '
+ if not self.matches_so:
+ reason += 'not link with so, '
# Post a highlighted message to lognote
self.message_post(
body=f"<div style='background-color: #fdf2e9; border: 1px solid #f5c6cb; padding: 10px;'>"
- f"<b>Note Return (Pinned):</b><br>{reason}</div>",
+ f"<b>Note (Pinned):</b><br>{reason}</div>",
subtype_id=self.env.ref("mail.mt_note").id
)
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 4c9d7658..a4031d52 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -192,9 +192,9 @@ class StockPicking(models.Model):
else:
raise UserError(f"Error saat mengirim ke Biteship: {response.content}")
- @api.constrains('driver_departure_date')
- def constrains_driver_departure_date(self):
- self.date_doc_kirim = self.driver_departure_date
+ # @api.constrains('driver_departure_date')
+ # def constrains_driver_departure_date(self):
+ # self.date_doc_kirim = self.driver_departure_date
@api.constrains('arrival_time')
def constrains_arrival_time(self):