summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-15 08:45:56 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-15 08:45:56 +0700
commit3a131c68a6b72d8477ddff4e42de9fda7ca78b46 (patch)
tree8a3d768536852a33b3cf860e921f6892edad83a6 /indoteknik_custom/models
parent21d01b83204677e3cf8d355b6198290b6dbb9d52 (diff)
parent28bbc495e76b6492935f7270888872135ae4d944 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into cr_renca_find
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/stock_picking.py7
-rw-r--r--indoteknik_custom/models/tukar_guling.py6
-rw-r--r--indoteknik_custom/models/user_pengajuan_tempo_request.py6
3 files changed, 9 insertions, 10 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 602b1145..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('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
+ 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 9bcb0988..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('SO Direvisi?', 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}")
diff --git a/indoteknik_custom/models/user_pengajuan_tempo_request.py b/indoteknik_custom/models/user_pengajuan_tempo_request.py
index 6e8498f7..6a553946 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'),
@@ -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)
@@ -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(',', '.')