[IMP] account_asset_management: pre-commit auto fixes

This commit is contained in:
sbiosca-s73
2024-05-29 08:41:11 +02:00
parent d762cecd73
commit af421268fc
19 changed files with 202 additions and 206 deletions

View File

@@ -17,36 +17,37 @@ Assets Management
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/16.0/account_asset_management
:target: https://github.com/OCA/account-financial-tools/tree/17.0/account_asset_management
:alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_asset_management
:target: https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_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/account-financial-tools&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This Module manages the assets owned by a company. It will keep
track of depreciation's occurred on those assets. And it allows to create
This Module manages the assets owned by a company. It will keep track of
depreciation's occurred on those assets. And it allows to create
accounting entries from the depreciation lines.
The full asset life-cycle is managed (from asset creation to asset removal).
The full asset life-cycle is managed (from asset creation to asset
removal).
Assets can be created manually as well as automatically
(via the creation of an accounting entry on the asset account).
Assets can be created manually as well as automatically (via the
creation of an accounting entry on the asset account).
Depreciation Journal Entries can be created manually in the "Deprecation Board" tab,
or automatically by two ways:
Depreciation Journal Entries can be created manually in the "Deprecation
Board" tab, or automatically by two ways:
* Using the "Invoicing/Assets/Compute Assets" wizard.
* Activating the "Asset Management: Generate assets" cron.
- Using the "Invoicing/Assets/Compute Assets" wizard.
- Activating the "Asset Management: Generate assets" cron.
These options are compatibles each other.
The module contains a large number of functional enhancements compared to
the standard account_asset module from Odoo.
The module contains a large number of functional enhancements compared
to the standard account_asset module from Odoo.
**Table of contents**
@@ -62,48 +63,52 @@ Changelog
=========
14.0.1.0.0 (2021-01-08)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* [BREAKING] Removed all functionality associated with `account.fiscal.year`
- [BREAKING] Removed all functionality associated with
account.fiscal.year
13.0.3.0.0 (2021-07-06)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* Allow to reverse the posting of a depreciation line instead of deleting the
journal entry.
- Allow to reverse the posting of a depreciation line instead of
deleting the journal entry.
13.0.2.0.0 (2021-02-19)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* Add support for multi-company
- Add support for multi-company
13.0.1.0.0 (2019-10-21)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* Python code and views were adapted to be compatible with v13.
* When assets are created through accounting journal items,
they are created when the journal items is posted.
* When a Bill Invoice is created or modified, at the time it is saved,
for each line that has an Asset profile and Quantity 'N'
greater than 1, it will be replaced by 'N' lines identical to it but
with quantity 1. This was done to maintain the same behavior as in
the previous version, in which for each asset created there is a
Journal Item. In addition, this solution does not change the data
model which does not cause migration scripts.
* The configuration option was removed so the only function of that is to
allow the module to be uninstalled by unchecking that configuration option.
* Tests were adapted.
- Python code and views were adapted to be compatible with v13.
- When assets are created through accounting journal items, they are
created when the journal items is posted.
- When a Bill Invoice is created or modified, at the time it is saved,
for each line that has an Asset profile and Quantity 'N' greater than
1, it will be replaced by 'N' lines identical to it but with quantity
1. This was done to maintain the same behavior as in the previous
version, in which for each asset created there is a Journal Item. In
addition, this solution does not change the data model which does not
cause migration scripts.
- The configuration option was removed so the only function of that is
to allow the module to be uninstalled by unchecking that
configuration option.
- Tests were adapted.
12.0.2.1.0 (2019-10-21)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* [IMP] Add option to calculate depreciation table by days
- [IMP] Add option to calculate depreciation table by days
12.0.1.0.0 (2019-01-13)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------
* [BREAKING] account.asset: parent_path has replaced parent_left & parent_right (TODO: migration script)
* [BREAKING] account.asset.recompute.trigger: depends on date_range.py (TODO: re-implement in account_fiscal_year.py)
- [BREAKING] account.asset: parent_path has replaced parent_left &
parent_right (TODO: migration script)
- [BREAKING] account.asset.recompute.trigger: depends on date_range.py
(TODO: re-implement in account_fiscal_year.py)
Bug Tracker
===========
@@ -111,7 +116,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/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/account-financial-tools/issues/new?body=module:%20account_asset_management%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_asset_management%0Aversion:%2017.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.
@@ -119,42 +124,42 @@ Credits
=======
Authors
~~~~~~~
-------
* Noviat
Contributors
~~~~~~~~~~~~
------------
* OpenERP SA
* Luc De Meyer (Noviat)
* Frédéric Clementi (camptocamp)
* Florian Dacosta (Akretion)
* Stéphane Bidoul (Acsone)
* Adrien Peiffer (Acsone)
* Akim Juillerat <akim.juillerat@camptocamp.com>
* Henrik Norlin (Apps2GROW)
* Maxence Groine <mgroine@fiefmanage.ch>
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
* Saran Lim. <saranl@ecosoft.co.th>
* `Tecnativa <https://www.tecnativa.com>`_:
- OpenERP SA
- Luc De Meyer (Noviat)
- Frédéric Clementi (camptocamp)
- Florian Dacosta (Akretion)
- Stéphane Bidoul (Acsone)
- Adrien Peiffer (Acsone)
- Akim Juillerat <akim.juillerat@camptocamp.com>
- Henrik Norlin (Apps2GROW)
- Maxence Groine <mgroine@fiefmanage.ch>
- Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
- Saran Lim. <saranl@ecosoft.co.th>
- `Tecnativa <https://www.tecnativa.com>`__:
* Ernesto Tejeda
* Pedro M. Baeza
* João Marques
* Víctor Martínez
- Ernesto Tejeda
- Pedro M. Baeza
- João Marques
- Víctor Martínez
* `ForgeFlow <https://www.forgeflow.com>`_:
- `ForgeFlow <https://www.forgeflow.com>`__:
* Jordi Ballester <jordi.ballester@forgeflow.com>
* Miquel Raïch <miquel.raich@forgeflow.com>
- Jordi Ballester <jordi.ballester@forgeflow.com>
- Miquel Raïch <miquel.raich@forgeflow.com>
* `Sygel <https://www.sygel.es>`_:
- `Sygel <https://www.sygel.es>`__:
* Manuel Regidor <manuel.regidor@sygel.es>
- Manuel Regidor <manuel.regidor@sygel.es>
Maintainers
~~~~~~~~~~~
-----------
This module is maintained by the OCA.
@@ -166,6 +171,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/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_asset_management>`_ project on GitHub.
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/17.0/account_asset_management>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -24,7 +24,7 @@ READONLY_STATES = {
}
class DummyFy(object):
class DummyFy:
def __init__(self, *args, **argv):
for key, arg in argv.items():
setattr(self, key, arg)
@@ -638,7 +638,6 @@ class AccountAsset(models.Model):
line_i_start = 0
def compute_depreciation_board(self):
line_obj = self.env["account.asset.line"]
for asset in self:
@@ -1039,7 +1038,6 @@ class AccountAsset(models.Model):
def _compute_depreciation_table_lines(
self, table, depreciation_start_date, depreciation_stop_date, line_dates
):
self.ensure_one()
currency = self.company_id.currency_id
asset_sign = 1 if self.depreciation_base >= 0 else -1
@@ -1052,7 +1050,6 @@ class AccountAsset(models.Model):
)
for i, entry in enumerate(table):
lines = []
fy_amount_check = 0.0
fy_amount = entry["fy_amount"]
@@ -1231,7 +1228,7 @@ class AccountAsset(models.Model):
tb = "".join(format_exception(*exc_info()))
asset_ref = depreciation.asset_id.name
if depreciation.asset_id.code:
asset_ref = "[{}] {}".format(depreciation.asset_id.code, asset_ref)
asset_ref = f"[{depreciation.asset_id.code}] {asset_ref}"
error_log += _(
"\nError while processing asset '{ref}': {exception}"
).format(ref=asset_ref, exception=str(e))

View File

@@ -219,7 +219,7 @@ class AccountAssetLine(models.Model):
asset = self.asset_id
move_data = {
"date": depreciation_date,
"ref": "{} - {}".format(asset.name, self.name),
"ref": f"{asset.name} - {self.name}",
"journal_id": asset.profile_id.journal_id.id,
}
return move_data

View File

@@ -256,6 +256,6 @@ class AccountMoveLine(models.Model):
aml = self.with_context(check_move_validity=False)
qty = self.quantity
name = self.name
aml.write({"quantity": 1, "name": "{} {}".format(name, 1)})
aml.write({"quantity": 1, "name": f"{name} {1}"})
for i in range(1, int(qty)):
aml.copy({"name": "{} {}".format(name, i + 1)})
aml.copy({"name": f"{name} {i + 1}"})

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -0,0 +1,21 @@
- OpenERP SA
- Luc De Meyer (Noviat)
- Frédéric Clementi (camptocamp)
- Florian Dacosta (Akretion)
- Stéphane Bidoul (Acsone)
- Adrien Peiffer (Acsone)
- Akim Juillerat \<<akim.juillerat@camptocamp.com>\>
- Henrik Norlin (Apps2GROW)
- Maxence Groine \<<mgroine@fiefmanage.ch>\>
- Kitti Upariphutthiphong \<<kittiu@ecosoft.co.th>\>
- Saran Lim. \<<saranl@ecosoft.co.th>\>
- [Tecnativa](https://www.tecnativa.com):
- Ernesto Tejeda
- Pedro M. Baeza
- João Marques
- Víctor Martínez
- [ForgeFlow](https://www.forgeflow.com):
- Jordi Ballester \<<jordi.ballester@forgeflow.com>\>
- Miquel Raïch \<<miquel.raich@forgeflow.com>\>
- [Sygel](https://www.sygel.es):
- Manuel Regidor \<<manuel.regidor@sygel.es>\>

View File

@@ -1,26 +0,0 @@
* OpenERP SA
* Luc De Meyer (Noviat)
* Frédéric Clementi (camptocamp)
* Florian Dacosta (Akretion)
* Stéphane Bidoul (Acsone)
* Adrien Peiffer (Acsone)
* Akim Juillerat <akim.juillerat@camptocamp.com>
* Henrik Norlin (Apps2GROW)
* Maxence Groine <mgroine@fiefmanage.ch>
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
* Saran Lim. <saranl@ecosoft.co.th>
* `Tecnativa <https://www.tecnativa.com>`_:
* Ernesto Tejeda
* Pedro M. Baeza
* João Marques
* Víctor Martínez
* `ForgeFlow <https://www.forgeflow.com>`_:
* Jordi Ballester <jordi.ballester@forgeflow.com>
* Miquel Raïch <miquel.raich@forgeflow.com>
* `Sygel <https://www.sygel.es>`_:
* Manuel Regidor <manuel.regidor@sygel.es>

View File

@@ -0,0 +1,20 @@
This Module manages the assets owned by a company. It will keep track of
depreciation's occurred on those assets. And it allows to create
accounting entries from the depreciation lines.
The full asset life-cycle is managed (from asset creation to asset
removal).
Assets can be created manually as well as automatically (via the
creation of an accounting entry on the asset account).
Depreciation Journal Entries can be created manually in the "Deprecation
Board" tab, or automatically by two ways:
- Using the "Invoicing/Assets/Compute Assets" wizard.
- Activating the "Asset Management: Generate assets" cron.
These options are compatibles each other.
The module contains a large number of functional enhancements compared
to the standard account_asset module from Odoo.

View File

@@ -1,19 +0,0 @@
This Module manages the assets owned by a company. It will keep
track of depreciation's occurred on those assets. And it allows to create
accounting entries from the depreciation lines.
The full asset life-cycle is managed (from asset creation to asset removal).
Assets can be created manually as well as automatically
(via the creation of an accounting entry on the asset account).
Depreciation Journal Entries can be created manually in the "Deprecation Board" tab,
or automatically by two ways:
* Using the "Invoicing/Assets/Compute Assets" wizard.
* Activating the "Asset Management: Generate assets" cron.
These options are compatibles each other.
The module contains a large number of functional enhancements compared to
the standard account_asset module from Odoo.

View File

@@ -0,0 +1,41 @@
## 14.0.1.0.0 (2021-01-08)
> - \[BREAKING\] Removed all functionality associated with
> account.fiscal.year
## 13.0.3.0.0 (2021-07-06)
- Allow to reverse the posting of a depreciation line instead of
deleting the journal entry.
## 13.0.2.0.0 (2021-02-19)
- Add support for multi-company
## 13.0.1.0.0 (2019-10-21)
- Python code and views were adapted to be compatible with v13.
- When assets are created through accounting journal items, they are
created when the journal items is posted.
- When a Bill Invoice is created or modified, at the time it is saved,
for each line that has an Asset profile and Quantity 'N' greater than
1, it will be replaced by 'N' lines identical to it but with
quantity 1. This was done to maintain the same behavior as in the
previous version, in which for each asset created there is a Journal
Item. In addition, this solution does not change the data model which
does not cause migration scripts.
- The configuration option was removed so the only function of that is
to allow the module to be uninstalled by unchecking that configuration
option.
- Tests were adapted.
## 12.0.2.1.0 (2019-10-21)
- \[IMP\] Add option to calculate depreciation table by days
## 12.0.1.0.0 (2019-01-13)
- \[BREAKING\] account.asset: parent_path has replaced parent_left &
parent_right (TODO: migration script)
- \[BREAKING\] account.asset.recompute.trigger: depends on date_range.py
(TODO: re-implement in account_fiscal_year.py)

View File

@@ -1,43 +0,0 @@
14.0.1.0.0 (2021-01-08)
~~~~~~~~~~~~~~~~~~~~~~~
* [BREAKING] Removed all functionality associated with `account.fiscal.year`
13.0.3.0.0 (2021-07-06)
~~~~~~~~~~~~~~~~~~~~~~~
* Allow to reverse the posting of a depreciation line instead of deleting the
journal entry.
13.0.2.0.0 (2021-02-19)
~~~~~~~~~~~~~~~~~~~~~~~
* Add support for multi-company
13.0.1.0.0 (2019-10-21)
~~~~~~~~~~~~~~~~~~~~~~~
* Python code and views were adapted to be compatible with v13.
* When assets are created through accounting journal items,
they are created when the journal items is posted.
* When a Bill Invoice is created or modified, at the time it is saved,
for each line that has an Asset profile and Quantity 'N'
greater than 1, it will be replaced by 'N' lines identical to it but
with quantity 1. This was done to maintain the same behavior as in
the previous version, in which for each asset created there is a
Journal Item. In addition, this solution does not change the data
model which does not cause migration scripts.
* The configuration option was removed so the only function of that is to
allow the module to be uninstalled by unchecking that configuration option.
* Tests were adapted.
12.0.2.1.0 (2019-10-21)
~~~~~~~~~~~~~~~~~~~~~~~
* [IMP] Add option to calculate depreciation table by days
12.0.1.0.0 (2019-01-13)
~~~~~~~~~~~~~~~~~~~~~~~
* [BREAKING] account.asset: parent_path has replaced parent_left & parent_right (TODO: migration script)
* [BREAKING] account.asset.recompute.trigger: depends on date_range.py (TODO: re-implement in account_fiscal_year.py)

View File

@@ -30,7 +30,6 @@ class AssetReportXlsx(models.AbstractModel):
return [s1, s2, s3]
def _get_asset_template(self):
asset_template = {
"account": {
"header": {"type": "string", "value": _("Account")},
@@ -296,7 +295,6 @@ class AssetReportXlsx(models.AbstractModel):
return asset_template
def _get_acquisition_ws_params(self, wb, data, wiz):
acquisition_template = self._get_asset_template()
acquisition_template.update(
self.env["account.asset"]._xls_acquisition_template()
@@ -316,7 +314,6 @@ class AssetReportXlsx(models.AbstractModel):
}
def _get_active_ws_params(self, wb, data, wiz):
active_template = self._get_asset_template()
active_template.update(self.env["account.asset"]._xls_active_template())
wl_act = self.env["account.asset"]._xls_active_fields()
@@ -334,7 +331,6 @@ class AssetReportXlsx(models.AbstractModel):
}
def _get_removal_ws_params(self, wb, data, wiz):
removal_template = self._get_asset_template()
removal_template.update(self.env["account.asset"]._xls_removal_template())
wl_dsp = self.env["account.asset"]._xls_removal_fields()
@@ -352,8 +348,7 @@ class AssetReportXlsx(models.AbstractModel):
}
def _get_title(self, wiz, report, frmt="normal"):
prefix = "{} - {}".format(wiz.date_from, wiz.date_to)
prefix = f"{wiz.date_from} - {wiz.date_to}"
if report == "acquisition":
if frmt == "normal":
title = prefix + " : " + _("New Acquisitions")
@@ -461,7 +456,7 @@ class AssetReportXlsx(models.AbstractModel):
report = ws_params["report_type"]
def asset_filter(asset):
filt = getattr(self, "{}_filter".format(report))
filt = getattr(self, f"{report}_filter")
return filt(wiz, asset)
def _has_assets(group, group_val):
@@ -560,7 +555,7 @@ class AssetReportXlsx(models.AbstractModel):
row_pos = self._report_title(ws, row_pos, ws_params, data, wiz)
def asset_filter(asset):
filt = getattr(self, "{}_filter".format(report))
filt = getattr(self, f"{report}_filter")
return filt(wiz, asset)
assets = data["assets"].filtered(asset_filter)
@@ -618,7 +613,6 @@ class AssetReportXlsx(models.AbstractModel):
processed = []
for entry in entries:
period_start_value_cell = period_start_value_pos and self._rowcol_to_cell(
row_pos, period_start_value_pos
)

View File

@@ -369,22 +369,23 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:843676bebe20651c6131f76d504144b859ebaca41703b5b8a63f97a7b4998070
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-tools/tree/16.0/account_asset_management"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_asset_management"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This Module manages the assets owned by a company. It will keep
track of depreciations occurred on those assets. And it allows to create
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-tools/tree/17.0/account_asset_management"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_asset_management"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This Module manages the assets owned by a company. It will keep track of
depreciations occurred on those assets. And it allows to create
accounting entries from the depreciation lines.</p>
<p>The full asset life-cycle is managed (from asset creation to asset removal).</p>
<p>Assets can be created manually as well as automatically
(via the creation of an accounting entry on the asset account).</p>
<p>Depreciation Journal Entries can be created manually in the “Deprecation Board” tab,
or automatically by two ways:</p>
<p>The full asset life-cycle is managed (from asset creation to asset
removal).</p>
<p>Assets can be created manually as well as automatically (via the
creation of an accounting entry on the asset account).</p>
<p>Depreciation Journal Entries can be created manually in the “Deprecation
Board” tab, or automatically by two ways:</p>
<ul class="simple">
<li>Using the “Invoicing/Assets/Compute Assets” wizard.</li>
<li>Activating the “Asset Management: Generate assets” cron.</li>
</ul>
<p>These options are compatibles each other.</p>
<p>The module contains a large number of functional enhancements compared to
the standard account_asset module from Odoo.</p>
<p>The module contains a large number of functional enhancements compared
to the standard account_asset module from Odoo.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -417,15 +418,16 @@ the standard account_asset module from Odoo.</p>
<h2><a class="toc-backref" href="#toc-entry-3">14.0.1.0.0 (2021-01-08)</a></h2>
<blockquote>
<ul class="simple">
<li>[BREAKING] Removed all functionality associated with <cite>account.fiscal.year</cite></li>
<li>[BREAKING] Removed all functionality associated with
account.fiscal.year</li>
</ul>
</blockquote>
</div>
<div class="section" id="section-2">
<h2><a class="toc-backref" href="#toc-entry-4">13.0.3.0.0 (2021-07-06)</a></h2>
<ul class="simple">
<li>Allow to reverse the posting of a depreciation line instead of deleting the
journal entry.</li>
<li>Allow to reverse the posting of a depreciation line instead of
deleting the journal entry.</li>
</ul>
</div>
<div class="section" id="section-3">
@@ -438,17 +440,18 @@ journal entry.</li>
<h2><a class="toc-backref" href="#toc-entry-6">13.0.1.0.0 (2019-10-21)</a></h2>
<ul class="simple">
<li>Python code and views were adapted to be compatible with v13.</li>
<li>When assets are created through accounting journal items,
they are created when the journal items is posted.</li>
<li>When assets are created through accounting journal items, they are
created when the journal items is posted.</li>
<li>When a Bill Invoice is created or modified, at the time it is saved,
for each line that has an Asset profile and Quantity N
greater than 1, it will be replaced by N lines identical to it but
with quantity 1. This was done to maintain the same behavior as in
the previous version, in which for each asset created there is a
Journal Item. In addition, this solution does not change the data
model which does not cause migration scripts.</li>
<li>The configuration option was removed so the only function of that is to
allow the module to be uninstalled by unchecking that configuration option.</li>
for each line that has an Asset profile and Quantity N greater than
1, it will be replaced by N lines identical to it but with quantity
1. This was done to maintain the same behavior as in the previous
version, in which for each asset created there is a Journal Item. In
addition, this solution does not change the data model which does not
cause migration scripts.</li>
<li>The configuration option was removed so the only function of that is
to allow the module to be uninstalled by unchecking that
configuration option.</li>
<li>Tests were adapted.</li>
</ul>
</div>
@@ -461,8 +464,10 @@ allow the module to be uninstalled by unchecking that configuration option.</li>
<div class="section" id="section-6">
<h2><a class="toc-backref" href="#toc-entry-8">12.0.1.0.0 (2019-01-13)</a></h2>
<ul class="simple">
<li>[BREAKING] account.asset: parent_path has replaced parent_left &amp; parent_right (TODO: migration script)</li>
<li>[BREAKING] account.asset.recompute.trigger: depends on date_range.py (TODO: re-implement in account_fiscal_year.py)</li>
<li>[BREAKING] account.asset: parent_path has replaced parent_left &amp;
parent_right (TODO: migration script)</li>
<li>[BREAKING] account.asset.recompute.trigger: depends on date_range.py
(TODO: re-implement in account_fiscal_year.py)</li>
</ul>
</div>
</div>
@@ -471,7 +476,7 @@ allow the module to be uninstalled by unchecking that configuration option.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_asset_management%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_asset_management%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -521,7 +526,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/16.0/account_asset_management">OCA/account-financial-tools</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/17.0/account_asset_management">OCA/account-financial-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -15,7 +15,7 @@ class TestAssetManagementXls(AccountTestInvoicingCommon):
super(TestAssetManagementXls, cls).setUpClass()
module = __name__.split("addons.")[1].split(".")[0]
cls.xls_report_name = "{}.asset_report_xls".format(module)
cls.xls_report_name = f"{module}.asset_report_xls"
cls.wiz_model = cls.env["wiz.account.asset.report"]
cls.company = cls.env.ref("base.main_company")
# Ensure we have something to report on

View File

@@ -25,9 +25,7 @@ class AccountAssetCompute(models.TransientModel):
if error_log:
module = __name__.split("addons.")[1].split(".")[0]
result_view = self.env.ref(
"{}.{}_view_form_result".format(module, self._table)
)
result_view = self.env.ref(f"{module}.{self._table}_view_form_result")
self.note = _("Compute Assets errors") + ":\n" + error_log
return {
"name": _("Compute Assets result"),

View File

@@ -161,9 +161,7 @@ class AccountAssetRemove(models.TransientModel):
asset_id = self.env.context.get("active_id")
asset = self.env["account.asset"].browse(asset_id)
asset_ref = (
asset.code and "{} (ref: {})".format(asset.name, asset.code) or asset.name
)
asset_ref = asset.code and f"{asset.name} (ref: {asset.code})" or asset.name
if self.env.context.get("early_removal"):
residual_value = self._prepare_early_removal(asset)

View File

@@ -60,7 +60,7 @@ class WizAccountAssetReport(models.TransientModel):
.decode("ascii")
)
prefix = "".join(x for x in prefix if x.isalnum())
report_file = "{}_asset_report".format(prefix)
report_file = f"{prefix}_asset_report"
else:
report_file = "asset_report"
report = {

2
requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
python-dateutil