summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/report_logbook_sj.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-05-22 14:48:58 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-05-22 14:48:58 +0700
commitd0bcbd1b93719b2145a5cdc131f6fa6c9272a4e6 (patch)
treeedea7a81fa684d1d83da958f2dc21dac3aa39cea /indoteknik_custom/models/report_logbook_sj.py
parent30fabf53eedc6fa07a55d2a90ce8e6d4887cbf1e (diff)
count line on report logbook sj
Diffstat (limited to 'indoteknik_custom/models/report_logbook_sj.py')
-rw-r--r--indoteknik_custom/models/report_logbook_sj.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/report_logbook_sj.py b/indoteknik_custom/models/report_logbook_sj.py
index 093848b5..a1b6299c 100644
--- a/indoteknik_custom/models/report_logbook_sj.py
+++ b/indoteknik_custom/models/report_logbook_sj.py
@@ -30,6 +30,13 @@ class ReportLogbookSJ(models.Model):
tracking=True,
)
+ count_line = fields.Char(string='Count Line', compute='_compute_count_line')
+
+ @api.depends('report_logbook_sj_line')
+ def _compute_count_line(self):
+ for rec in self:
+ rec.count_line = len(rec.report_logbook_sj_line)
+
@api.model
def create(self, vals):
vals['name'] = self.env['ir.sequence'].next_by_code('report.logbook.sj') or '0'