Skip to content

Commit

Permalink
[ADD] l10n_ec: Missing withhold tax and fix migration
Browse files Browse the repository at this point in the history
- Add 319 profit withhold tax with new percentage amount: 2%
- Fixed migration for profit withhold tax 3440

closes odoo#157871

Signed-off-by: Josse Colpaert <jco@odoo.com>
  • Loading branch information
stevTresCloud committed Mar 18, 2024
1 parent 87f3e99 commit 84320e7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions addons/l10n_ec/data/account_tax_template_withhold_profit_data.xml
Expand Up @@ -609,6 +609,7 @@
</record>
<record id="tax_withhold_profit_319" model="account.tax.template">
<field name="name">319 1.75% Cuotas de Arrendamiento Mercantil (Prestado por Sociedades), Inclusive la de Opción de Compra</field>
<field name="active">False</field>
<field name="type_tax_use">none</field>
<field name="amount_type">percent</field>
<field name="sequence">70</field>
Expand Down Expand Up @@ -640,6 +641,39 @@
'minus_report_expression_ids': [ref('tax_report_line_103_369_tag')],
})]"/>
</record>
<record id="tax_withhold_profit_319_2" model="account.tax.template">
<field name="name">319 2% Cuotas de Arrendamiento Mercantil (Prestado por Sociedades), Inclusive la de Opción de Compra</field>
<field name="type_tax_use">none</field>
<field name="amount_type">percent</field>
<field name="sequence">70</field>
<field name="amount">-2</field>
<field name="description">319</field>
<field name="l10n_ec_code_applied">369</field>
<field name="l10n_ec_code_base">319</field>
<field name="l10n_ec_code_ats">319</field>
<field name="chart_template_id" ref="l10n_ec.l10n_ec_ifrs"/>
<field name="tax_group_id" ref="tax_group_withhold_income_purchase"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
'repartition_type': 'base',
'plus_report_expression_ids': [ref('tax_report_line_103_319_tag')],
}),
(0,0, {
'repartition_type': 'tax',
'account_id': ref('l10n_ec.ret_ir_2x100'),
'plus_report_expression_ids': [ref('tax_report_line_103_369_tag')],
})]"/>
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
'repartition_type': 'base',
'minus_report_expression_ids': [ref('tax_report_line_103_319_tag')],
}),
(0,0, {
'repartition_type': 'tax',
'account_id': ref('l10n_ec.ret_ir_2x100'),
'minus_report_expression_ids': [ref('tax_report_line_103_369_tag')],
})]"/>
</record>
<record id="tax_withhold_profit_320" model="account.tax.template">
<field name="name">320 8% Por Arrendamiento Bienes Inmuebles</field>
<field name="active">False</field>
Expand Down
3 changes: 2 additions & 1 deletion addons/l10n_ec/migrations/3.6/post-migrate_update_taxes.py
Expand Up @@ -25,7 +25,7 @@ def update_ec_codes(cr, env):
companies = env['res.company'].search([('chart_template_id', '=', env.ref('l10n_ec.l10n_ec_ifrs').id)])
for company in companies:
taxes_to_update = [
(f'{company.id}_tax_withhold_profit_3440', '3340', '3940')
(f'{company.id}_tax_withhold_profit_3440', '3440', '3940')
]
for xml_id, l10n_ec_code_base, l10n_ec_code_applied in taxes_to_update:
cr.execute("UPDATE account_tax SET l10n_ec_code_base=%s, l10n_ec_code_applied=%s "
Expand All @@ -51,6 +51,7 @@ def inactivate_taxes_replaced(cr, env):
f'{company.id}_tax_withhold_profit_314D', # replaced by tax_withhold_profit_314D_10
f'{company.id}_tax_withhold_profit_320', # replaced by tax_withhold_profit_320_10
f'{company.id}_tax_withhold_profit_322', # replaced by tax_withhold_profit_322_1
f'{company.id}_tax_withhold_profit_319', # replaced by tax_withhold_profit_319_2
]
for xml_id in taxes_to_inactivate:
cr.execute("UPDATE account_tax SET active=False "
Expand Down

0 comments on commit 84320e7

Please sign in to comment.