Skip to content

Commit

Permalink
[MOV] assets_management: Rename to l10n_it_asset_management
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech committed Dec 14, 2023
1 parent 802110d commit 7683a7c
Show file tree
Hide file tree
Showing 76 changed files with 6,455 additions and 6,367 deletions.
3,072 changes: 0 additions & 3,072 deletions assets_management/i18n/assets_management.pot

This file was deleted.

3,188 changes: 0 additions & 3,188 deletions assets_management/i18n/it.po

This file was deleted.

1 change: 0 additions & 1 deletion assets_management/tests/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ITA - Gestione Cespiti
======================

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
Expand All @@ -17,10 +17,10 @@ ITA - Gestione Cespiti
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/14.0/assets_management
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_asset_management
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-assets_management
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_asset_management
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=14.0
Expand Down Expand Up @@ -62,7 +62,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/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/OCA/l10n-italy/issues/new?body=module:%20assets_management%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_asset_management%0Aversion:%2014.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.

Expand Down Expand Up @@ -97,6 +97,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/assets_management>`_ project on GitHub.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_asset_management>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from . import models
from . import report
from . import wizard
from .hooks import pre_absorb_old_module
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@
],
"assets": {
"web.assets_backend": [
"assets_management/static/src/js/*",
"assets_management/static/src/xml/*",
"l10n_it_asset_management/static/src/js/*",
"l10n_it_asset_management/static/src/xml/*",
],
},
"development_status": "Beta",
"installable": True,
"external_dependencies": {
"python": [
"openupgradelib",
],
},
"pre_init_hook": "pre_absorb_old_module",
}
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions l10n_it_asset_management/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

NEW_MODULE_NAME = "l10n_it_asset_management"
OLD_MODULE_NAME = "assets_management"

RENAMED_MODELS = [
(
"report.assets_management.report_asset_journal_xlsx",
"report.l10n_it_asset_management.report_asset_journal_xlsx",
),
(
"report.assets_management.report_asset_previsional_xlsx",
"report.l10n_it_asset_management.report_asset_previsional_xlsx",
),
]


def migrate_old_module(cr):
openupgrade.rename_models(

Check warning on line 22 in l10n_it_asset_management/hooks.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/hooks.py#L22

Added line #L22 was not covered by tests
cr,
RENAMED_MODELS,
)


def pre_absorb_old_module(cr):
if openupgrade.is_module_installed(cr, OLD_MODULE_NAME):
openupgrade.update_module_names(

Check warning on line 30 in l10n_it_asset_management/hooks.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/hooks.py#L30

Added line #L30 was not covered by tests
cr,
[
(OLD_MODULE_NAME, NEW_MODULE_NAME),
],
merge_modules=True,
)
migrate_old_module(cr)

Check warning on line 37 in l10n_it_asset_management/hooks.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/hooks.py#L37

Added line #L37 was not covered by tests
3,072 changes: 3,072 additions & 0 deletions l10n_it_asset_management/i18n/assets_management.pot

Large diffs are not rendered by default.

3,188 changes: 3,188 additions & 0 deletions l10n_it_asset_management/i18n/it.po

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions l10n_it_asset_management/migrations/16.0.1.0.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

# pylint: disable=odoo-addons-relative-import
# because
# from ... import hooks
# raises
# ImportError: attempted relative import with no known parent package
from odoo.addons.l10n_it_asset_management import hooks


def migrate(cr, installed_version):
# Used by OpenUpgrade when module is in `apriori`
hooks.migrate_old_module(cr)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def open_wizard_manage_asset(self):
if not lines:
raise ValidationError(_("Every line is already linked to an asset."))

Check warning on line 101 in l10n_it_asset_management/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/models/account_move.py#L101

Added line #L101 was not covered by tests

xmlid = "assets_management.action_wizard_account_move_manage_asset"
xmlid = "l10n_it_asset_management.action_wizard_account_move_manage_asset"
act = self.env.ref(xmlid).read()[0]
ctx = dict(self._context)
ctx.update(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def onchange_purchase_date(self):

def launch_wizard_generate_depreciations(self):
self.ensure_one()
xmlid = "assets_management.action_wizard_asset_generate_depreciation"
xmlid = "l10n_it_asset_management.action_wizard_asset_generate_depreciation"
[act] = self.env.ref(xmlid).read()
ctx = dict(self._context)
ctx.update(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def print_report(self, report_type=None):
def do_print(self, report_type):
self.ensure_one()

Check warning on line 117 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L117

Added line #L117 was not covered by tests
if report_type == "qweb-pdf":
xml_id = "assets_management.report_asset_journal_pdf"
xml_id = "l10n_it_asset_management.report_asset_journal_pdf"

Check warning on line 119 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L119

Added line #L119 was not covered by tests
elif report_type == "qweb-html":
xml_id = "assets_management.report_asset_journal_html"
xml_id = "l10n_it_asset_management.report_asset_journal_html"

Check warning on line 121 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L121

Added line #L121 was not covered by tests
else:
xml_id = "assets_management.report_asset_journal_xlsx"
xml_id = "l10n_it_asset_management.report_asset_journal_xlsx"
report = self.env.ref(xml_id)
return report.report_action(self)

Check warning on line 125 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L123-L125

Added lines #L123 - L125 were not covered by tests

Expand All @@ -130,7 +130,7 @@ def get_html(self, given_context=None):
context = dict(self.env.context)
context.update(given_context or {})
report = self or self.browse(context.get("active_id"))
xml_id = "assets_management.template_asset_journal_report"
xml_id = "l10n_it_asset_management.template_asset_journal_report"

Check warning on line 133 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L130-L133

Added lines #L130 - L133 were not covered by tests

result = {}

Check warning on line 135 in l10n_it_asset_management/report/asset_journal.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_journal.py#L135

Added line #L135 was not covered by tests
if report:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class AssetJournalXslx(models.AbstractModel):
_name = "report.assets_management.report_asset_journal_xlsx"
_name = "report.l10n_it_asset_management.report_asset_journal_xlsx"
_description = "Report Asset Journal Xlsx"
_inherit = "report.account_financial_report.abstract_report_xlsx"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def print_report(self, report_type=None):
def do_print(self, report_type):
self.ensure_one()

Check warning on line 122 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L122

Added line #L122 was not covered by tests
if report_type == "qweb-pdf":
xml_id = "assets_management.report_asset_previsional_pdf"
xml_id = "l10n_it_asset_management.report_asset_previsional_pdf"

Check warning on line 124 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L124

Added line #L124 was not covered by tests
elif report_type == "qweb-html":
xml_id = "assets_management.report_asset_previsional_html"
xml_id = "l10n_it_asset_management.report_asset_previsional_html"

Check warning on line 126 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L126

Added line #L126 was not covered by tests
else:
xml_id = "assets_management.report_asset_previsional_xlsx"
xml_id = "l10n_it_asset_management.report_asset_previsional_xlsx"
report = self.env.ref(xml_id)
return report.report_action(self)

Check warning on line 130 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L128-L130

Added lines #L128 - L130 were not covered by tests

Expand All @@ -135,7 +135,7 @@ def get_html(self, given_context=None):
context = dict(self.env.context)
context.update(given_context or {})
report = self or self.browse(context.get("active_id"))
xml_id = "assets_management.template_asset_previsional_report"
xml_id = "l10n_it_asset_management.template_asset_previsional_report"

Check warning on line 138 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L135-L138

Added lines #L135 - L138 were not covered by tests

result = {}

Check warning on line 140 in l10n_it_asset_management/report/asset_previsional.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_asset_management/report/asset_previsional.py#L140

Added line #L140 was not covered by tests
if report:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class AssetJournalXslx(models.AbstractModel):
_name = "report.assets_management.report_asset_previsional_xlsx"
_name = "report.l10n_it_asset_management.report_asset_previsional_xlsx"
_description = "Report Asset Previsional Xlsx"
_inherit = "report.account_financial_report.abstract_report_xlsx"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<div class="article">
<link
href="/assets_management/static/src/css/report.css"
href="/l10n_it_asset_management/static/src/css/report.css"
rel="stylesheet"
/>
<t t-out="0" />
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
<field name="report_type">qweb-html</field>
<field
name="paperformat_id"
ref="assets_management.asset_journal_a4_landscape"
ref="l10n_it_asset_management.asset_journal_a4_landscape"
/>
<field name="report_name">assets_management.template_asset_journal_qweb</field>
<field name="report_file">assets_management.template_asset_journal_html</field>
<field
name="report_name"
>l10n_it_asset_management.template_asset_journal_qweb</field>
<field
name="report_file"
>l10n_it_asset_management.template_asset_journal_html</field>
</record>

<record id="report_asset_journal_pdf" model="ir.actions.report">
Expand All @@ -18,18 +22,26 @@
<field name="report_type">qweb-pdf</field>
<field
name="paperformat_id"
ref="assets_management.asset_journal_a4_landscape"
ref="l10n_it_asset_management.asset_journal_a4_landscape"
/>
<field name="report_name">assets_management.template_asset_journal_qweb</field>
<field name="report_file">assets_management.template_asset_journal_qweb</field>
<field
name="report_name"
>l10n_it_asset_management.template_asset_journal_qweb</field>
<field
name="report_file"
>l10n_it_asset_management.template_asset_journal_qweb</field>
</record>

<record id="report_asset_journal_xlsx" model="ir.actions.report">
<field name="name">Asset Report XLSX</field>
<field name="model">report_asset_journal</field>
<field name="report_type">xlsx</field>
<field name="report_name">assets_management.report_asset_journal_xlsx</field>
<field name="report_file">assets_management.report_asset_journal_xlsx</field>
<field
name="report_name"
>l10n_it_asset_management.report_asset_journal_xlsx</field>
<field
name="report_file"
>l10n_it_asset_management.report_asset_journal_xlsx</field>
</record>

<record id="report_asset_previsional_html" model="ir.actions.report">
Expand All @@ -38,14 +50,14 @@
<field name="report_type">qweb-html</field>
<field
name="paperformat_id"
ref="assets_management.asset_previsional_a4_landscape"
ref="l10n_it_asset_management.asset_previsional_a4_landscape"
/>
<field
name="report_name"
>assets_management.template_asset_previsional_qweb</field>
>l10n_it_asset_management.template_asset_previsional_qweb</field>
<field
name="report_file"
>assets_management.template_asset_previsional_html</field>
>l10n_it_asset_management.template_asset_previsional_html</field>
</record>

<record id="report_asset_previsional_pdf" model="ir.actions.report">
Expand All @@ -54,14 +66,14 @@
<field name="report_type">qweb-pdf</field>
<field
name="paperformat_id"
ref="assets_management.asset_previsional_a4_landscape"
ref="l10n_it_asset_management.asset_previsional_a4_landscape"
/>
<field
name="report_name"
>assets_management.template_asset_previsional_qweb</field>
>l10n_it_asset_management.template_asset_previsional_qweb</field>
<field
name="report_file"
>assets_management.template_asset_previsional_qweb</field>
>l10n_it_asset_management.template_asset_previsional_qweb</field>
</record>

<record id="report_asset_previsional_xlsx" model="ir.actions.report">
Expand All @@ -70,10 +82,10 @@
<field name="report_type">xlsx</field>
<field
name="report_name"
>assets_management.report_asset_previsional_xlsx</field>
>l10n_it_asset_management.report_asset_previsional_xlsx</field>
<field
name="report_file"
>assets_management.report_asset_previsional_xlsx</field>
>l10n_it_asset_management.report_asset_previsional_xlsx</field>
</record>

</odoo>
Loading

0 comments on commit 7683a7c

Please sign in to comment.