Debian Codegraph @

addons/l10n_br/demo/account_demo.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
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 # vendor bills and refund must be manually numbered (l10n_br uses the standard AccountMove._is_manual_document_number())
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