mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-28 03:12:04 +02:00
19.0 vanilla
This commit is contained in:
parent
89c6e82fe7
commit
1b82c20a58
572 changed files with 43570 additions and 53303 deletions
20
odoo-bringout-oca-ocb-l10n_br/l10n_br/demo/account_demo.py
Normal file
20
odoo-bringout-oca-ocb-l10n_br/l10n_br/demo/account_demo.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@api.model
|
||||
def _get_demo_data_move(self, company=False):
|
||||
""" Set the l10n_latam_document_number on demo invoices """
|
||||
move_data = super()._get_demo_data_move(company)
|
||||
if company.account_fiscal_country_id.code == 'BR':
|
||||
number = 0
|
||||
for move in move_data.values():
|
||||
# vendor bills and refund must be manually numbered (l10n_br uses the standard AccountMove._is_manual_document_number())
|
||||
if move['move_type'] in ('in_invoice', 'in_refund'):
|
||||
move['l10n_latam_document_number'] = f'{number:08d}'
|
||||
number += 1
|
||||
|
||||
return move_data
|
||||
Loading…
Add table
Add a link
Reference in a new issue