diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-19 09:39:25 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-19 09:39:25 +0700 |
| commit | 10c0cd096353397ce26ad13b6967a35d13072fb6 (patch) | |
| tree | b3af310842eec98fe97d6f291ea55580d1de5a6a | |
| parent | 78a7df26d09b64fb9b3b45084212cbf19c1907a1 (diff) | |
label in move line same with ref in entries
| -rw-r--r-- | indoteknik_custom/models/account_move_line.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move_line.py b/indoteknik_custom/models/account_move_line.py index 37f7c77c..31950f4c 100644 --- a/indoteknik_custom/models/account_move_line.py +++ b/indoteknik_custom/models/account_move_line.py @@ -23,3 +23,11 @@ class AccountMoveLine(models.Model): else: account.is_required = False + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + if 'move_id' in vals: + move = self.env['account.move'].browse(vals['move_id']) + if move.move_type == 'entry': + vals['name'] = move.ref + return super().create(vals_list)
\ No newline at end of file |
