Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions l10n_es_account_capital_asset_tax_map_prorate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
=============================
Account Capital Asset Tax Map
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c5187b48bbb10bc95e6b14eb539a009c58351d2a86d41347f897911805688823
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github
:target: https://github.com/NuoBiT/odoo-addons/tree/18.0/l10n_es_account_capital_asset_tax_map_prorate
:alt: NuoBiT/odoo-addons

|badge1| |badge2| |badge3|

This module adds l10n_es_special_prorate data to capital assets tax map

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/NuoBiT/odoo-addons/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/NuoBiT/odoo-addons/issues/new?body=module:%20l10n_es_account_capital_asset_tax_map_prorate%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* NuoBiT Solutions SL

Contributors
------------

- `NuoBiT <https://www.nuobit.com>`__:

- Kilian Niubo [email protected]
- Deniz Gallo [email protected]

Maintainers
-----------

This module is part of the `NuoBiT/odoo-addons <https://github.com/NuoBiT/odoo-addons/tree/18.0/l10n_es_account_capital_asset_tax_map_prorate>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions l10n_es_account_capital_asset_tax_map_prorate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
19 changes: 19 additions & 0 deletions l10n_es_account_capital_asset_tax_map_prorate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright NuoBiT Solutions SL - Kilian Niubo <[email protected]>
# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "Account Capital Asset Tax Map",
"summary": "This module adds l10n_es_special_prorate "
"data to capital assets tax map",
"version": "18.0.1.0.0",
"category": "Accounting",
"author": "NuoBiT Solutions SL",
"website": "https://github.com/NuoBiT/odoo-addons",
"license": "AGPL-3",
"depends": [
"l10n_es_special_prorate",
"l10n_es_account_capital_asset",
],
"post_init_hook": "post_init_hook",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"id","tax_src_id","tax_dest_id"
"account_tax_template_p_priva4_bc_bi","account_tax_template_p_priva4_bc","account_tax_template_p_priva4_bi"
"account_tax_template_p_priva10_bc_bi","account_tax_template_p_priva10_bc","account_tax_template_p_priva10_bi"
"account_tax_template_p_priva21_bc_bi","account_tax_template_p_priva21_bc","account_tax_template_p_priva21_bi"
"account_tax_template_p_priva4_ic_bc_bi","account_tax_template_p_priva4_ic_bc","account_tax_template_p_priva4_ic_bi"
"account_tax_template_p_priva10_ic_bc_bi","account_tax_template_p_priva10_ic_bc","account_tax_template_p_priva10_ic_bi"
"account_tax_template_p_priva21_ic_bc_bi","account_tax_template_p_priva21_ic_bc","account_tax_template_p_priva21_ic_bi"
"account_tax_template_p_priva4_ibc_ibi","account_tax_template_p_priva4_ibc","account_tax_template_p_priva4_ibi"
"account_tax_template_p_priva10_ibc_ibi","account_tax_template_p_priva10_ibc","account_tax_template_p_priva10_ibi"
"account_tax_template_p_priva21_ibc_ibi","account_tax_template_p_priva21_ibc","account_tax_template_p_priva21_ibi"
55 changes: 55 additions & 0 deletions l10n_es_account_capital_asset_tax_map_prorate/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

import csv

from odoo.tools import file_open

_TEMPLATE_FILE = (
"l10n_es_account_capital_asset_tax_map_prorate"
"/data/template"
"/l10n.es.account.capital.asset.map.tax-es_common_mainland.csv"
)


def post_init_hook(env):
companies = (
env["res.company"]
.search([])
.filtered(lambda c: c.chart_template and c.chart_template.startswith("es_"))
)
if not companies:
return
with file_open(_TEMPLATE_FILE) as template_file:
records = list(csv.DictReader(template_file))
for company in companies:
existing = env["l10n.es.account.capital.asset.map.tax"].search_count(
[
("company_id", "=", company.id),
(
"tax_src_id.name",
"ilike",
"priva",
),
]
)
if existing:
continue
for record in records:
tax_src = env.ref(
f"account.{company.id}_{record['tax_src_id']}",
raise_if_not_found=False,
)
tax_dest = env.ref(
f"account.{company.id}_{record['tax_dest_id']}",
raise_if_not_found=False,
)
if not tax_src or not tax_dest:
continue
env["l10n.es.account.capital.asset.map.tax"].create(
{
"company_id": company.id,
"tax_src_id": tax_src.id,
"tax_dest_id": tax_dest.id,
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_chart_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import models

from odoo.addons.account.models.chart_template import template


class AccountChartTemplate(models.AbstractModel):
_inherit = "account.chart.template"

@template("es_common_mainland", "l10n.es.account.capital.asset.map.tax")
def _get_es_common_mainland_account_capital_asset_map_tax_prorate(self):
return self._parse_csv(
"es_common_mainland",
"l10n.es.account.capital.asset.map.tax",
module="l10n_es_account_capital_asset_tax_map_prorate",
)
3 changes: 3 additions & 0 deletions l10n_es_account_capital_asset_tax_map_prorate/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [NuoBiT](https://www.nuobit.com):
- Kilian Niubo <[email protected]>
- Deniz Gallo <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds l10n_es_special_prorate data to capital assets tax map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading