diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-30 15:35:20 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-30 15:35:20 +0700 |
| commit | b547143489e5bef27425199b36a9dd3984429421 (patch) | |
| tree | c70f9558c0710f2b820a3dd4eed96bbef133fc71 | |
| parent | f1927a4220d546756bc3a1cc5666aa2ef2c8d816 (diff) | |
label entries line same with ref move entry
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 85ed1d54..7760c69d 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -65,6 +65,13 @@ class AccountMove(models.Model): other_subtotal = fields.Float(string="Other Subtotal", compute='compute_other_subtotal') other_taxes = fields.Float(string="Other Taxes", compute='compute_other_taxes') + def _update_line_name_from_ref(self): + """Update all account.move.line name fields with ref from account.move""" + for move in self: + if move.move_type == 'entry' and move.ref and move.line_ids: + for line in move.line_ids: + line.name = move.ref + def compute_other_taxes(self): for rec in self: rec.other_taxes = rec.other_subtotal * 0.12 @@ -107,6 +114,7 @@ class AccountMove(models.Model): def create(self, vals): vals['nomor_kwitansi'] = self.env['ir.sequence'].next_by_code('nomor.kwitansi') or '0' result = super(AccountMove, self).create(vals) + result._update_line_name_from_ref() return result def compute_so_shipping_paid_by(self): |
