From aff9fdd49543648bfed395fff0c86af5b0269686 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 2 Jun 2023 14:16:33 +0700 Subject: add feature generate payment link midtrans --- indoteknik_custom/models/stock_picking.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index e63370f5..8c366082 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -256,6 +256,11 @@ class StockPicking(models.Model): if self.is_internal_use and not self.env.user.is_accounting: raise UserError("Harus di Approve oleh Accounting") + + if self.group_id.sale_id: + if self.group_id.sale_id.payment_link_midtrans: + if self.group_id.sale_id.payment_status != 'settlement': + raise UserError('Uang belum masuk (settlement), mohon konfirmasi ke sales atau finance') if self.is_internal_use: stock_move_lines = self.env['stock.move.line'].search([ -- cgit v1.2.3 From ed2cd466938f7aee19688b6402edbb3643ee21e1 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 2 Jun 2023 15:41:53 +0700 Subject: add missing table validation before run validate --- indoteknik_custom/models/stock_picking.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 8c366082..54b478ae 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -248,6 +248,9 @@ class StockPicking(models.Model): return def button_validate(self): + if self._name != 'stock.picking': + return super(StockPicking, self).button_validate() + if not self.picking_code: self.picking_code = self.env['ir.sequence'].next_by_code('stock.picking.code') or '0' -- cgit v1.2.3 From 237ea1205935d9f1bea5eb704df02e3835f9f82a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 14 Jun 2023 10:49:33 +0700 Subject: add note logistic for exclude calculate leadtime --- indoteknik_custom/models/stock_picking.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 54b478ae..c8424121 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -59,6 +59,10 @@ class StockPicking(models.Model): ('approved', 'Approved'), ], string='Approval Return Status', readonly=True, copy=False, index=True, tracking=3, help="Approval Status untuk Return") date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ, tidak berpengaruh ke Accounting") + note_logistic = fields.Selection([ + ('hold', 'Hold by Sales'), + ('not_paid', 'Customer belum bayar') + ], string='Note', help='jika field ini diisi maka tidak akan dihitung ke lead time') def action_create_invoice_from_mr(self): """Create the invoice associated to the PO. -- cgit v1.2.3