summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-01-24 12:00:12 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-01-24 12:00:12 +0700
commit965b9ef647f582664c8fe4d85831faca33642468 (patch)
tree42c8b742300aaf3f1facab373001ac2691fe1b87
parentabcb1dbdfd8f5443f6f331aeee1ab5f66c04670f (diff)
status printed di sj
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
-rw-r--r--indoteknik_custom/models/stock_picking.py4
-rw-r--r--indoteknik_custom/views/stock_picking.xml2
3 files changed, 8 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index ebadff06..984c8a23 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -302,9 +302,9 @@ class PurchaseOrder(models.Model):
res = super(PurchaseOrder, self).button_confirm()
current_time = datetime.now()
- if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
+ if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.is_purchasing_manager or not self.env.user.is_leader:
raise UserError("Beda Margin dengan Sales, harus approval Manager")
- if not self.sale_order_id and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
+ if not self.sale_order_id and not self.env.user.is_purchasing_manager or not self.env.user.is_leader:
raise UserError("Tidak ada link dengan SO, harus approval Manager")
send_email = False
self.add_product_to_pricelist()
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 2819d6e7..40c8c1f9 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -76,6 +76,10 @@ class StockPicking(models.Model):
carrier_id = fields.Many2one('delivery.carrier', string='Shipping Method')
shipping_status = fields.Char(string='Shipping Status', compute="_compute_shipping_status")
date_reserved = fields.Datetime(string="Date Reserved", help='Tanggal ter-reserved semua barang nya')
+ status_printed = fields.Selection([
+ ('not_printed', 'Belum Print'),
+ ('printed', 'Printed')
+ ], string='Printed SJ?', copy=False)
def _compute_shipping_status(self):
for rec in self:
diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml
index b0932d5a..979bede3 100644
--- a/indoteknik_custom/views/stock_picking.xml
+++ b/indoteknik_custom/views/stock_picking.xml
@@ -19,6 +19,7 @@
</field>
<field name="partner_id" position="after">
<field name="purchase_representative_id"/>
+ <field name="status_printed"/>
</field>
</field>
</record>
@@ -59,6 +60,7 @@
</field>
<field name="origin" position="after">
<field name="purchase_representative_id"/>
+ <field name="status_printed"/>
<field name="purchase_id"/>
<field name="date_doc_kirim"/>
<field name="summary_qty_operation"/>