| 1 |
# -*- coding: utf-8 -*- |
| 2 |
from odoo import models |
| 3 |
|
| 4 |
|
| 5 |
class AccountChartTemplate(models.AbstractModel): |
| 6 |
_inherit = "account.chart.template" |
| 7 |
|
| 8 |
def _post_load_demo_data(self, company=False): |
| 9 |
result = super()._post_load_demo_data(company) |
| 10 |
if company == self.env.ref('base.company_ri', raise_if_not_found=False): |
| 11 |
profits_wth_tax_119 = self.with_company(company).ref('ex_tax_withholding_profits_regimen_119_insc') |
| 12 |
pba_wth_applied = self.with_company(company).ref('ex_tax_withholding_iibb_ba_applied') |
| 13 |
# Create demo sequence for earnings wth |
| 14 |
seq_profits_wth = self.env['ir.sequence'].create({ |
| 15 |
'name': 'Earnings wth sequence', |
| 16 |
'padding': 1, |
| 17 |
'number_increment': 1, |
| 18 |
'implementation': 'standard', |
| 19 |
'company_id': self.env.ref('base.company_ri').id |
| 20 |
}) |
| 21 |
wth_sequence_id = seq_profits_wth.id |
| 22 |
|
| 23 |
# Add to partner Adhoc: 1) wth tax 119 and it`s sequence, 2) pba wth |
| 24 |
self.env['l10n_ar.partner.tax'].create({'tax_id': profits_wth_tax_119.id, 'partner_id': self.env.ref('l10n_ar.res_partner_adhoc').id, 'company_id': company.id}) |
| 25 |
profits_wth_tax_119.l10n_ar_withholding_sequence_id = wth_sequence_id |
| 26 |
self.env['l10n_ar.partner.tax'].create({'tax_id': pba_wth_applied.id, 'partner_id': self.env.ref('l10n_ar.res_partner_adhoc').id, 'company_id': company.id}) |
| 27 |
|
| 28 |
# Add to partner Belgrano: 1) wth tax 78 and it`s sequence, 2) pba wth |
| 29 |
earnings_wth_tax_78 = self.with_company(company).ref('ex_tax_withholding_profits_regimen_78_insc') |
| 30 |
self.env['l10n_ar.partner.tax'].create({'tax_id': earnings_wth_tax_78.id, 'partner_id': self.env.ref('l10n_ar.res_partner_mipyme').id, 'company_id': company.id}) |
| 31 |
earnings_wth_tax_78.l10n_ar_withholding_sequence_id = wth_sequence_id |
| 32 |
self.env['l10n_ar.partner.tax'].create({'tax_id': pba_wth_applied.id, 'partner_id': self.env.ref('l10n_ar.res_partner_mipyme').id, 'company_id': company.id}) |
| 33 |
|
| 34 |
return result |