diff options
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index ae7121da..0b91e79d 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1080,14 +1080,9 @@ class StockPicking(models.Model): return res - def ask_approval(self): if self.env.user.is_accounting: raise UserError("Bisa langsung Validate") - if self.env.user.is_logistic_approver and self.location_id.id == 57 or self.location_id== 57: - raise UserError("Bisa langsung Validate") - - # for calendar distribute only # if self.is_internal_use: @@ -1110,9 +1105,6 @@ class StockPicking(models.Model): if line.qty_done <= 0: raise UserError("Qty tidak boleh 0") pick.approval_status = 'pengajuan1' - if pick.location_id.id == 57: - pick.approval_status = 'pengajuan2' - return def ask_receipt_approval(self): if self.env.user.is_logistic_approver: @@ -1315,9 +1307,6 @@ class StockPicking(models.Model): if self.picking_type_id.code == 'incoming' and self.group_id.id == False and self.is_internal_use == False: raise UserError(_('Tidak bisa Validate jika tidak dari Document SO / PO')) - if self.is_internal_use and not self.env.user.is_logistic_approver and self.location_id.id == 57: - raise UserError("Harus di Approve oleh Logistik") - if self.is_internal_use and not self.env.user.is_accounting: raise UserError("Harus di Approve oleh Accounting") @@ -1344,7 +1333,6 @@ class StockPicking(models.Model): current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') self.date_reserved = current_time - # Validate Qty Demand Can't higher than Qty Product if self.location_dest_id.id == 58 and 'BU/INPUT/' in self.name: for move in self.move_ids_without_package: @@ -1360,22 +1348,19 @@ class StockPicking(models.Model): ) self.validation_minus_onhand_quantity() - loc = self.location_id - if loc.id == 57 and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan2']: - raise UserError ("Harus Ask Approval Logistik") self.responsible = self.env.user.id # self.send_koli_to_so() if self.picking_type_code == 'outgoing' and 'BU/OUT/' in self.name: self.check_koli() res = super(StockPicking, self).button_validate() - + # Penambahan link PO di Stock Journal untuk Picking BD for picking in self: if picking.name and 'BD/' in picking.name and picking.purchase_id: stock_journal = self.env['account.move'].search([ ('ref', 'ilike', picking.name + '%'), - ('journal_id', '=', 3) # Stock Journal ID - ], limit = 1) + ('journal_id', '=', 3) # Stock Journal ID + ], limit=1) if stock_journal: stock_journal.write({ 'purchase_order_id': picking.purchase_id.id |
