summaryrefslogtreecommitdiff
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
parent30fabf53eedc6fa07a55d2a90ce8e6d4887cbf1e (diff)
count line on report logbook sj
-rw-r--r--indoteknik_custom/models/report_logbook_sj.py7
-rw-r--r--indoteknik_custom/views/report_logbook_sj.xml1
2 files changed, 8 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'
diff --git a/indoteknik_custom/views/report_logbook_sj.xml b/indoteknik_custom/views/report_logbook_sj.xml
index 687464f0..147ae393 100644
--- a/indoteknik_custom/views/report_logbook_sj.xml
+++ b/indoteknik_custom/views/report_logbook_sj.xml
@@ -60,6 +60,7 @@
<field name="state" readonly="1"/>
<field name="created_by" readonly="1"/>
<field name="approve_by" readonly="1"/>
+ <field name="count_line" readonly="1"/>
</group>
</group>
<notebook>