| 1 |
|
| 2 |
import logging |
| 3 |
|
| 4 |
from odoo import api, models |
| 5 |
|
| 6 |
_logger = logging.getLogger(__name__) |
| 7 |
|
| 8 |
|
| 9 |
class AccountChartTemplate(models.AbstractModel): |
| 10 |
_inherit = "account.chart.template" |
| 11 |
|
| 12 |
@api.model |
| 13 |
def _get_demo_data_move(self, company=False): |
| 14 |
ref = self.env.ref |
| 15 |
move_data = super()._get_demo_data_move(company) |
| 16 |
if company.account_fiscal_country_id.code == "CL": |
| 17 |
foreign_invoice = ref('l10n_cl.dc_fe_dte').id |
| 18 |
foreign_credit_note = ref('l10n_cl.dc_ncex_dte').id |
| 19 |
self.env['account.journal'].search([ |
| 20 |
*self.env['account.journal']._check_company_domain(company), |
| 21 |
('type', '=', 'purchase'), |
| 22 |
]).l10n_latam_use_documents = False |
| 23 |
move_data[self.company_xmlid('demo_invoice_1')]['l10n_latam_document_type_id'] = foreign_invoice |
| 24 |
move_data[self.company_xmlid('demo_invoice_2')]['l10n_latam_document_type_id'] = foreign_invoice |
| 25 |
move_data[self.company_xmlid('demo_invoice_3')]['l10n_latam_document_type_id'] = foreign_invoice |
| 26 |
move_data[self.company_xmlid('demo_invoice_followup')]['l10n_latam_document_type_id'] = foreign_invoice |
| 27 |
move_data[self.company_xmlid('demo_invoice_5')]['l10n_latam_document_type_id'] = foreign_invoice |
| 28 |
move_data[self.company_xmlid('demo_invoice_6')]['l10n_latam_document_type_id'] = foreign_invoice |
| 29 |
move_data[self.company_xmlid('demo_invoice_7')]['l10n_latam_document_type_id'] = foreign_invoice |
| 30 |
move_data[self.company_xmlid('demo_invoice_8')]['l10n_latam_document_type_id'] = foreign_invoice |
| 31 |
move_data[self.company_xmlid('demo_invoice_equipment_purchase')]['l10n_latam_document_type_id'] = foreign_invoice |
| 32 |
move_data[self.company_xmlid('demo_invoice_9')]['l10n_latam_document_type_id'] = foreign_invoice |
| 33 |
move_data[self.company_xmlid('demo_invoice_10')]['l10n_latam_document_type_id'] = foreign_invoice |
| 34 |
move_data[self.company_xmlid('demo_move_auto_reconcile_1')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 35 |
move_data[self.company_xmlid('demo_move_auto_reconcile_2')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 36 |
move_data[self.company_xmlid('demo_move_auto_reconcile_3')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 37 |
move_data[self.company_xmlid('demo_move_auto_reconcile_4')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 38 |
move_data[self.company_xmlid('demo_move_auto_reconcile_5')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 39 |
move_data[self.company_xmlid('demo_move_auto_reconcile_6')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 40 |
move_data[self.company_xmlid('demo_move_auto_reconcile_7')]['l10n_latam_document_type_id'] = foreign_credit_note |
| 41 |
return move_data |