| 1 |
|
| 2 |
from odoo import fields, models, api |
| 3 |
|
| 4 |
|
| 5 |
class AccountJournal(models.Model): |
| 6 |
_inherit = 'account.journal' |
| 7 |
|
| 8 |
l10n_br_invoice_serial = fields.Char( |
| 9 |
'Series', copy=False, |
| 10 |
help='Brazil: Series number associated with this Journal. If more than one Series needs to be used, duplicate this Journal and assign the new Series to the duplicated Journal.' |
| 11 |
) |
| 12 |
|
| 13 |
@api.depends('l10n_br_invoice_serial') |
| 14 |
def _compute_display_name(self): |
| 15 |
res = super()._compute_display_name() |
| 16 |
for journal in self.filtered('l10n_br_invoice_serial'): |
| 17 |
journal.display_name = f'{journal.l10n_br_invoice_serial}-{journal.display_name}' |
| 18 |
|
| 19 |
return res |