summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-06-27 09:54:00 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-06-27 09:54:00 +0700
commit9704530832cbb70a8209e556a9a67a25fe8c11fc (patch)
tree0c92d7c479fd81d998d2cc0dec8334b9dc6fa48c /indoteknik_custom/models/sale_order.py
parent72888c5c59078195420f6a6da3ae1c65766390d7 (diff)
parent45dc1483342d9ec195c53711b5194e7ddf88b343 (diff)
Merge branch 'release' into nathan-dev
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index a17cf7c8..1a16f462 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -70,7 +70,7 @@ class SaleOrder(models.Model):
('partial_refund', 'Partial Refund'),
('partial_chargeback', 'Partial Chargeback'),
('authorize', 'Authorize'),
- ], string='Payment Status', help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle')
+ ], tracking=True, string='Payment Status', help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle')
date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ yang terakhir, tidak berpengaruh ke Accounting")
payment_type = fields.Char(string='Payment Type', help='Jenis pembayaran dengan Midtrans')
gross_amount = fields.Float(string='Gross Amount', help='Jumlah pembayaran yang dilakukan dengan Midtrans')
@@ -130,6 +130,16 @@ class SaleOrder(models.Model):
line_no += 1
line.line_no = line_no
# _logger.info('Calculate PO Line No %s' % line.id)
+
+ def write(self, vals):
+ res = super(SaleOrder, self).write(vals)
+
+ if 'carrier_id' in vals:
+ for picking in self.picking_ids:
+ if picking.state == 'assigned':
+ picking.carrier_id = self.carrier_id
+
+ return res
def calculate_so_status_beginning(self):
so_state = ['sale']
@@ -467,7 +477,7 @@ class SaleOrder(models.Model):
# must add product can sell validation
if not line.product_id.product_tmpl_id.sale_ok:
raise UserError('Product %s belum bisa dijual, harap hubungi finance' % line.product_id.display_name)
- if line.product_id.id == 232383:
+ if line.product_id.id == 224484:
raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara'))
if not line.vendor_id or not line.purchase_price or not line.purchase_tax_id:
raise UserError(_('Isi Vendor, Harga Beli, dan Tax sebelum Request Approval'))
@@ -572,6 +582,7 @@ class SaleOrderLine(models.Model):
delivery_amt_line = fields.Float('DeliveryAmtLine', compute='compute_delivery_amt_line')
fee_third_party_line = fields.Float('FeeThirdPartyLine', compute='compute_fee_third_party_line', default=0)
line_no = fields.Integer('No', default=0, copy=False)
+ note_procurement = fields.Char(string='Note', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring")
def compute_item_margin(self):
for line in self: