summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-07 18:21:38 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-10-07 18:21:38 +0700
commitdac161140e402d6a2bb1a3b43f951c2943c8f660 (patch)
tree3a12ac563664f53f2c99c5c3cd075e5ba7b84680
parent07ae0b7f2eab52daf5e33dc47450189537be2e1c (diff)
parent92d28be458ca53c9994a175225232b24c7fde283 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
-rw-r--r--indoteknik_custom/models/refund_sale_order.py14
-rw-r--r--indoteknik_custom/models/stock_picking.py12
2 files changed, 16 insertions, 10 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index f9adeeff..47565dfc 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -304,12 +304,14 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
])
- misc = self.env['account.move'].search([
- ('ref', 'ilike', invoices.mapped('name')[0]),
- ('ref', 'not ilike', 'reklas'),
- ('journal_id', '=', 13),
- ('state', '=', 'posted'),
- ])
+ misc = self.env['account.move']
+ if invoices:
+ misc = self.env['account.move'].search([
+ ('ref', 'ilike', invoices.mapped('name')[0]),
+ ('ref', 'not ilike', 'reklas'),
+ ('journal_id', '=', 13),
+ ('state', '=', 'posted'),
+ ])
moves2 = self.env['account.move']
if so_ids:
so_names = self.env['sale.order'].browse(so_ids).mapped('name')
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index a2bd7339..4772c433 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1340,11 +1340,17 @@ class StockPicking(models.Model):
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 and self.approval_status == 'pengajuan2':
- # raise UserError("Harus di Approve oleh Logistik")
+ # raise UserError("Harus di Approve oleh Logistik")
- if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan1', 'pengajuan2'] and self.location_id.id == 57:
+ if self.is_internal_use and self.approval_status in ['pengajuan1', '', False] and 'BU/IU' in self.name and self.is_bu_iu == True:
+ raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu")
+
+ if self.is_internal_use and not self.env.user.is_logistic_approver and self.approval_status in ['pengajuan2'] and self.is_bu_iu == True and 'BU/IU' in self.name:
raise UserError("Harus di Approve oleh Logistik")
+ if self.is_internal_use and not self.env.user.is_accounting and self.approval_status in ['pengajuan1', '', False] and self.is_bu_iu == False:
+ raise UserError("Harus di Approve oleh Accounting")
+
if self.picking_type_id.id == 28 and not self.env.user.is_logistic_approver:
raise UserError("Harus di Approve oleh Logistik")
@@ -1353,8 +1359,6 @@ class StockPicking(models.Model):
if self.is_internal_use and self.approval_status == 'pengajuan2':
self.approval_status = 'approved'
- elif self.is_internal_use and self.approval_status in ['pengajuan1', '', False]:
- raise UserError("Tidak Bisa Validate, set approval status ke approval logistik terlebih dahhulu")
elif self.picking_type_id.code == 'incoming':
self.approval_receipt_status = 'approved'