From 50d5259f8af1c9bbaee5d6ceb75e70d8aaa29084 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 13:35:40 +0700 Subject: change permission inventory adjusment --- indoteknik_custom/models/stock_inventory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/stock_inventory.py b/indoteknik_custom/models/stock_inventory.py index 432d9225..84eb5a17 100644 --- a/indoteknik_custom/models/stock_inventory.py +++ b/indoteknik_custom/models/stock_inventory.py @@ -53,8 +53,8 @@ class StockInventory(models.Model): return "00001" # Jika belum ada data, mulai dari 00001 def action_start(self): - if self.env.user.id not in [21, 17, 6277]: - raise UserError("Hanya Rafly, denise, dan faisal yang bisa start inventory") + if self.env.user.id not in [21, 17, 571, 28]: + raise UserError("Hanya Rafly, Denise, Iqmal, dan Stephan yang bisa start inventory") return super(StockInventory, self).action_start() @api.model -- cgit v1.2.3 From da5617f49ec011c80d4ce6b04ce025f18151e575 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Wed, 10 Dec 2025 14:03:53 +0700 Subject: validate permission internal transfer --- indoteknik_custom/models/stock_picking.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 2f99a85a..28d082df 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1453,6 +1453,24 @@ class StockPicking(models.Model): raise UserError( f"Tidak bisa validasi {picking.name} sebelum {prev_picking.name} divalidasi." ) + + def internal_transfer_val(self): + for rec in self: + # Gudang service + if rec.location_dest_id.id == 98 and self.env.user.id not in [21, 17]: + raise UserError(f"Transfer ke gudang {rec.location_dest_id.name} harus di approve Rafly H. atau Denise") + # Gudang selisih + if rec.location_dest_id.id == 47 and self.env.user.id not in [21, 17]: + raise UserError(f"Transfer ke gudang {rec.location_dest_id.name} harus di approve Rafly H. atau Denise") + + # Gudang Rusak + if rec.location_dest_id.id == 62 and self.env.user.id not in [21, 17]: + raise UserError(f"Transfer ke gudang {rec.location_dest_id.name} harus di approve Rafly H. atau Denise") + + # Gudang Peminjaman + if rec.location_dest_id.id == 48 and self.env.user.id not in [21, 17]: + raise UserError(f"Transfer ke gudang {rec.location_dest_id.name} harus di approve Rafly H. atau Denise") + def button_validate(self): self.check_invoice_date() _logger.info("Kode Picking: %s", self.picking_type_id.code) @@ -1463,6 +1481,8 @@ class StockPicking(models.Model): group_id = self.env.ref('indoteknik_custom.group_role_merchandiser').id users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) active_model = self.env.context.get('active_model') + if self.picking_type_id.id in [26, 10, 20, 32, 53, 52]: + self.internal_transfer_val() if self.tukar_guling_po_id and self.tukar_guling_po_id.return_type == 'tukar_guling': self.validate_seq_vcm() if self.is_so_fiktif == True: -- cgit v1.2.3 From 7d7dafff9996f7ed7de731a6c1498a5ff72ebb89 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 10:35:34 +0700 Subject: cr logistic delivery date and flag revisi SO tukar guling --- indoteknik_custom/models/stock_picking.py | 6 ++++++ indoteknik_custom/models/tukar_guling.py | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 28d082df..602b1145 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -202,6 +202,12 @@ class StockPicking(models.Model): so_num = fields.Char('SO Number', compute='_get_so_num') is_so_fiktif = fields.Boolean('SO Fiktif?', compute='_compute_is_so_fiktif', tracking=3) payment_term = fields.Char('Payment Term', compute='_get_partner_payment_term') + is_rev_tg = fields.Boolean('Revisi SO', compute='_compute_is_rev_tg', store=False) + + @api.depends('tukar_guling_id.rev_tukar_guling') + def _compute_is_rev_tg(self): + for record in self: + record.is_rev_tg = record.tukar_guling_id.rev_tukar_guling if record.tukar_guling_id else False @api.depends('sale_id.payment_term_id') def _get_partner_payment_term(self): diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index f31c68d0..388d83f7 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -87,6 +87,7 @@ class TukarGuling(models.Model): is_has_invoice = fields.Boolean('Has Invoice?', compute='_compute_is_has_invoice', readonly=True, default=False) invoice_id = fields.Many2many('account.move', string='Invoice Ref', readonly=True) + rev_tukar_guling = fields.Boolean('SO Direvisi?', default=False, tracking=3) @api.depends('origin', 'operations') def _compute_origin_so(self): @@ -808,7 +809,8 @@ class TukarGuling(models.Model): srt_picking.write({ 'group_id': bu_out.group_id.id, 'tukar_guling_id': record.id, - 'sale_order': record.origin + 'sale_order': record.origin, + 'note': record.notes, }) created_returns.append(srt_picking) _logger.info(f"✅ SRT created: {srt_picking.name}") @@ -868,7 +870,11 @@ class TukarGuling(models.Model): ort_picking.write({ 'group_id': bu_out.group_id.id, 'tukar_guling_id': record.id, - 'sale_order': record.origin + 'sale_order': record.origin, + 'sj_return_date': bu_out.sj_return_date, + 'driver_arrival_date': bu_out.driver_arrival_date, + 'delivery_date': bu_out.delivery_date, + 'note': record.notes, }) created_returns.append(ort_picking) @@ -913,7 +919,8 @@ class TukarGuling(models.Model): new_pick.write({ 'group_id': bu_out.group_id.id, 'tukar_guling_id': record.id, - 'sale_order': record.origin + 'sale_order': record.origin, + 'note': record.notes, }) new_pick.action_assign() new_pick.action_confirm() @@ -952,7 +959,8 @@ class TukarGuling(models.Model): new_out.write({ 'group_id': bu_out.group_id.id, 'tukar_guling_id': record.id, - 'sale_order': record.origin + 'sale_order': record.origin, + 'note': record.notes, }) created_returns.append(new_out) _logger.info(f"✅ BU/OUT Baru dari SRT created: {new_out.name}") -- cgit v1.2.3 From 8996a5b127f4bb3bf8926d23b3e79d25de8ddc76 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 10:50:30 +0700 Subject: rev ccm --- indoteknik_custom/models/tukar_guling.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index 388d83f7..9bcb0988 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -961,6 +961,9 @@ class TukarGuling(models.Model): 'tukar_guling_id': record.id, 'sale_order': record.origin, 'note': record.notes, + 'sj_return_date': bu_out.sj_return_date if record.rev_tukar_guling else False, + 'driver_arrival_date': bu_out.driver_arrival_date if record.rev_tukar_guling else False, + 'delivery_date': bu_out.delivery_date if record.rev_tukar_guling else False, }) created_returns.append(new_out) _logger.info(f"✅ BU/OUT Baru dari SRT created: {new_out.name}") -- cgit v1.2.3 From 080df35099b90ca3c42e07bb0c8b181f123c173e Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 11:20:50 +0700 Subject: revisi sales ccm --- indoteknik_custom/models/stock_picking.py | 2 +- indoteknik_custom/models/tukar_guling.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 602b1145..003b1f47 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -202,7 +202,7 @@ class StockPicking(models.Model): so_num = fields.Char('SO Number', compute='_get_so_num') is_so_fiktif = fields.Boolean('SO Fiktif?', compute='_compute_is_so_fiktif', tracking=3) payment_term = fields.Char('Payment Term', compute='_get_partner_payment_term') - is_rev_tg = fields.Boolean('Revisi SO', compute='_compute_is_rev_tg', store=False) + is_rev_tg = fields.Boolean('Administrasi', compute='_compute_is_rev_tg', store=False) @api.depends('tukar_guling_id.rev_tukar_guling') def _compute_is_rev_tg(self): diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index 9bcb0988..577047be 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -87,7 +87,7 @@ class TukarGuling(models.Model): is_has_invoice = fields.Boolean('Has Invoice?', compute='_compute_is_has_invoice', readonly=True, default=False) invoice_id = fields.Many2many('account.move', string='Invoice Ref', readonly=True) - rev_tukar_guling = fields.Boolean('SO Direvisi?', default=False, tracking=3) + rev_tukar_guling = fields.Boolean('Administrasi?', default=False, tracking=3) @api.depends('origin', 'operations') def _compute_origin_so(self): -- cgit v1.2.3 From d67b6738618cacc7d3cc8cf96736c8f709ed077a Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 13:45:58 +0700 Subject: cr renca remove domain tempo duration --- indoteknik_custom/models/user_pengajuan_tempo_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/user_pengajuan_tempo_request.py b/indoteknik_custom/models/user_pengajuan_tempo_request.py index 6e8498f7..8c12a810 100644 --- a/indoteknik_custom/models/user_pengajuan_tempo_request.py +++ b/indoteknik_custom/models/user_pengajuan_tempo_request.py @@ -46,7 +46,7 @@ class UserPengajuanTempoRequest(models.Model): user_id = fields.Many2one('res.partner', string='User') user_company_id = fields.Many2one('res.partner', string='Company') pengajuan_tempo_id = fields.Many2one('user.pengajuan.tempo', string='Form Tempo') - tempo_duration = fields.Many2one('account.payment.term', string='Durasi Tempo', tracking=3, domain=[('id', 'in', [24, 25, 29, 32])]) + tempo_duration = fields.Many2one('account.payment.term', string='Durasi Tempo', tracking=3) tempo_limit = fields.Integer(string='Limit Tempo', tracking=3) state_tempo = fields.Selection([ ('draft', 'Pengajuan Tempo'), @@ -688,4 +688,4 @@ class UserPengajuanTempoRequest(models.Model): def format_currency(self, number): number = int(number) - return "{:,}".format(number).replace(',', '.') \ No newline at end of file + return "{:,}".format(number).replace(',', '.') -- cgit v1.2.3 From 0e3fb3afe5d7d73b2f5b55e51297f122c3dd6a39 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 15:39:41 +0700 Subject: fix ccm --- indoteknik_custom/models/stock_picking.py | 7 +------ indoteknik_custom/models/tukar_guling.py | 6 +++++- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 003b1f47..2465fa96 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -202,12 +202,7 @@ class StockPicking(models.Model): so_num = fields.Char('SO Number', compute='_get_so_num') is_so_fiktif = fields.Boolean('SO Fiktif?', compute='_compute_is_so_fiktif', tracking=3) payment_term = fields.Char('Payment Term', compute='_get_partner_payment_term') - is_rev_tg = fields.Boolean('Administrasi', compute='_compute_is_rev_tg', store=False) - - @api.depends('tukar_guling_id.rev_tukar_guling') - def _compute_is_rev_tg(self): - for record in self: - record.is_rev_tg = record.tukar_guling_id.rev_tukar_guling if record.tukar_guling_id else False + is_rev_tg = fields.Boolean('Administrasi') @api.depends('sale_id.payment_term_id') def _get_partner_payment_term(self): diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index 577047be..682c478a 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -87,7 +87,7 @@ class TukarGuling(models.Model): is_has_invoice = fields.Boolean('Has Invoice?', compute='_compute_is_has_invoice', readonly=True, default=False) invoice_id = fields.Many2many('account.move', string='Invoice Ref', readonly=True) - rev_tukar_guling = fields.Boolean('Administrasi?', default=False, tracking=3) + rev_tukar_guling = fields.Boolean('Administrasi?', tracking=3) @api.depends('origin', 'operations') def _compute_origin_so(self): @@ -811,6 +811,7 @@ class TukarGuling(models.Model): 'tukar_guling_id': record.id, 'sale_order': record.origin, 'note': record.notes, + 'is_rev_tg': bool(record.rev_tukar_guling), }) created_returns.append(srt_picking) _logger.info(f"✅ SRT created: {srt_picking.name}") @@ -875,6 +876,7 @@ class TukarGuling(models.Model): 'driver_arrival_date': bu_out.driver_arrival_date, 'delivery_date': bu_out.delivery_date, 'note': record.notes, + 'is_rev_tg': bool(record.rev_tukar_guling), }) created_returns.append(ort_picking) @@ -921,6 +923,7 @@ class TukarGuling(models.Model): 'tukar_guling_id': record.id, 'sale_order': record.origin, 'note': record.notes, + 'is_rev_tg': bool(record.rev_tukar_guling), }) new_pick.action_assign() new_pick.action_confirm() @@ -964,6 +967,7 @@ class TukarGuling(models.Model): 'sj_return_date': bu_out.sj_return_date if record.rev_tukar_guling else False, 'driver_arrival_date': bu_out.driver_arrival_date if record.rev_tukar_guling else False, 'delivery_date': bu_out.delivery_date if record.rev_tukar_guling else False, + 'is_rev_tg': bool(record.rev_tukar_guling), }) created_returns.append(new_out) _logger.info(f"✅ BU/OUT Baru dari SRT created: {new_out.name}") -- cgit v1.2.3 From a09346c4e73f35b8e58b933dde8513b25a3a9ca2 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Fri, 12 Dec 2025 17:03:50 +0700 Subject: remove domain durasi tempo --- indoteknik_custom/models/user_pengajuan_tempo_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom/models') diff --git a/indoteknik_custom/models/user_pengajuan_tempo_request.py b/indoteknik_custom/models/user_pengajuan_tempo_request.py index 8c12a810..6a553946 100644 --- a/indoteknik_custom/models/user_pengajuan_tempo_request.py +++ b/indoteknik_custom/models/user_pengajuan_tempo_request.py @@ -91,7 +91,7 @@ class UserPengajuanTempoRequest(models.Model): website_tempo = fields.Char(string='Website', related='pengajuan_tempo_id.website_tempo', store=True, tracking=True, readonly=False) portal = fields.Boolean(string='Portal Website', related='pengajuan_tempo_id.portal', store=True, tracking=True, readonly=False) estimasi_tempo = fields.Char(string='Estimasi Pembelian Pertahun', related='pengajuan_tempo_id.estimasi_tempo', store=True, tracking=True, readonly=False) - tempo_duration_origin = fields.Many2one('account.payment.term', string='Durasi Tempo', related='tempo_duration', store=True, tracking=True, readonly=False, domain=[('id', 'in', [24, 25, 29, 32])]) + tempo_duration_origin = fields.Many2one('account.payment.term', string='Durasi Tempo', related='tempo_duration', store=True, tracking=True, readonly=False) tempo_limit_origin = fields.Char(string='Limit Tempo', related='pengajuan_tempo_id.tempo_limit' , store=True, tracking=True, readonly=False) category_produk_ids = fields.Many2many('product.public.category', string='Kategori Produk yang Digunakan', related='pengajuan_tempo_id.category_produk_ids', readonly=False) -- cgit v1.2.3