summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/down_payment.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py
index ab30337a..8d70aa69 100644
--- a/indoteknik_custom/models/down_payment.py
+++ b/indoteknik_custom/models/down_payment.py
@@ -590,6 +590,12 @@ class RealizationDownPaymentUseLine(models.Model):
nominal = fields.Float(string='Nominal', required=True)
done_attachment = fields.Boolean(string='Checked', default=False)
+ lot_of_attachment = fields.Selection(
+ related='realization_id.lot_of_attachment',
+ string='Lot of Attachment (Related)',
+ store=False
+ )
+
attachment_type = fields.Selection([
('pdf', 'PDF'),
('image', 'Image'),
@@ -640,7 +646,7 @@ class RealizationDownPayment(models.Model):
name = fields.Char(string='Nama', readonly=True, tracking=3)
title = fields.Char(string='Judul', tracking=3)
goals = fields.Text(string='Tujuan', tracking=3)
- related = fields.Char(string='Terkait', tracking=3,)
+ related = fields.Char(string='Terkait', tracking=3)
pemberian_line_ids = fields.One2many(
'realization.down.payment.line', 'realization_id', string='Rincian Pemberian'
@@ -700,9 +706,24 @@ class RealizationDownPayment(models.Model):
('image', 'Image'),
], string="Attachment Type", default='pdf')
+ lot_of_attachment = fields.Selection([
+ ('one_for_all_line', '1 Attachment Untuk Semua Line Penggunaan PUM'),
+ ('one_for_one_line', '1 Attachment per 1 Line Penggunaan PUM'),
+ ], string = "Banyaknya Attachment", default='one_for_one_line')
+
move_id = fields.Many2one('account.move', string='Journal Entries', domain=[('move_type', '=', 'entry')])
is_cab_visible = fields.Boolean(string='Is Journal Uang Muka Visible', compute='_compute_is_cab_visible')
+ @api.onchange('lot_of_attachment')
+ def _onchange_lot_of_attachment(self):
+ if self.lot_of_attachment == 'one_for_all_line':
+ for line in self.penggunaan_line_ids:
+ line.attachment_file_pdf = False
+ line.attachment_file_image = False
+ line.attachment_filename_pdf = False
+ line.attachment_filename_image = False
+
+
@api.depends('move_id.state')
def _compute_is_cab_visible(self):
for rec in self: