| 1 |
|
| 2 |
from odoo import models, api |
| 3 |
|
| 4 |
|
| 5 |
class AccountChartTemplate(models.AbstractModel): |
| 6 |
_inherit = 'account.chart.template' |
| 7 |
|
| 8 |
@api.model |
| 9 |
def _get_demo_data_move(self, company=False): |
| 10 |
""" Set the l10n_latam_document_number on demo invoices """ |
| 11 |
move_data = super()._get_demo_data_move(company) |
| 12 |
if company.account_fiscal_country_id.code == 'BR': |
| 13 |
number = 0 |
| 14 |
for move in move_data.values(): |
| 15 |
|
| 16 |
if move['move_type'] in ('in_invoice', 'in_refund'): |
| 17 |
move['l10n_latam_document_number'] = f'{number:08d}' |
| 18 |
number += 1 |
| 19 |
|
| 20 |
return move_data |