19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:16 +01:00
parent 89c6e82fe7
commit 1b82c20a58
572 changed files with 43570 additions and 53303 deletions

View file

@ -6,38 +6,36 @@ from odoo import api, models
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
class AccountChartTemplate(models.AbstractModel):
_inherit = "account.chart.template"
@api.model
def _get_demo_data(self):
yield ('res.partner', {
'base.res_partner_12': {
'l10n_cl_sii_taxpayer_type': '4',
},
'base.res_partner_2': {
'l10n_cl_sii_taxpayer_type': '4',
},
})
yield ('l10n_latam.document.type', {
'l10n_cl.dc_fe_dte': {'active': True},
})
for model, data in super()._get_demo_data():
yield model, data
@api.model
def _get_demo_data_move(self):
def _get_demo_data_move(self, company=False):
ref = self.env.ref
cid = self.env.company.id
model, data = super()._get_demo_data_move()
if self.env.company.account_fiscal_country_id.code == "CL":
foreign = ref('l10n_cl.dc_fe_dte').id
move_data = super()._get_demo_data_move(company)
if company.account_fiscal_country_id.code == "CL":
foreign_invoice = ref('l10n_cl.dc_fe_dte').id
foreign_credit_note = ref('l10n_cl.dc_ncex_dte').id
self.env['account.journal'].search([
*self.env['account.journal']._check_company_domain(company),
('type', '=', 'purchase'),
('company_id', '=', self.env.company.id),
]).l10n_latam_use_documents = False
data[f'{cid}_demo_invoice_1']['l10n_latam_document_type_id'] = foreign
data[f'{cid}_demo_invoice_2']['l10n_latam_document_type_id'] = foreign
data[f'{cid}_demo_invoice_3']['l10n_latam_document_type_id'] = foreign
data[f'{cid}_demo_invoice_followup']['l10n_latam_document_type_id'] = foreign
return model, data
move_data[self.company_xmlid('demo_invoice_1')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_2')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_3')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_followup')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_5')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_6')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_7')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_8')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_equipment_purchase')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_9')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_invoice_10')]['l10n_latam_document_type_id'] = foreign_invoice
move_data[self.company_xmlid('demo_move_auto_reconcile_1')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_2')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_3')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_4')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_5')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_6')]['l10n_latam_document_type_id'] = foreign_credit_note
move_data[self.company_xmlid('demo_move_auto_reconcile_7')]['l10n_latam_document_type_id'] = foreign_credit_note
return move_data