diff options
| -rw-r--r-- | indoteknik_custom/models/report_logbook_sj.py | 7 | ||||
| -rw-r--r-- | indoteknik_custom/views/report_logbook_sj.xml | 1 |
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> |
