fixup! [10.0][FIX] account_asset_management - issues #731

This commit is contained in:
Tonow-c2c
2018-11-19 11:01:27 +01:00
parent 676f0fe9b4
commit d0be0e2d0c
3 changed files with 16 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ Excel based reporting is available via the 'account_asset_management_xls' module
The module contains a large number of functional enhancements compared to
the standard account_asset module from Odoo.
* When the depreciation board an asset is compute, lines computed are flagged 'Init'
* When you compute the asset depreciation board, lines are flagged 'Init'
if they are before **Lock Date** `fiscalyear_lock_date`
Configuration

View File

@@ -616,7 +616,7 @@ class AccountAsset(models.Model):
- years: duration in calendar years, considering also leap years
"""
fy = self.env['date.range'].browse(fy_id)
fy_date_start =fields.Datetime.from_string(fy.date_start)
fy_date_start = fields.Datetime.from_string(fy.date_start)
fy_date_stop = fields.Datetime.from_string(fy.date_end)
days = (fy_date_stop - fy_date_start).days + 1
months = (fy_date_stop.year - fy_date_start.year) * 12 \
@@ -809,11 +809,12 @@ class AccountAsset(models.Model):
return line_dates
def _compute_depreciation_table_lines(
self, table,
depreciation_start_date,
depreciation_stop_date,
line_dates,
fiscalyear_lock_date):
self,
table,
depreciation_start_date,
depreciation_stop_date,
line_dates,
fiscalyear_lock_date):
digits = self.env['decimal.precision'].precision_get('Account')
asset_sign = 1 if self.depreciation_base >= 0 else -1

View File

@@ -3,6 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import time
from datetime import date
import odoo.tests.common as common
from odoo import tools
@@ -27,6 +28,13 @@ class TestAssetManagement(common.TransactionCase):
self.asset_model = self.env['account.asset']
self.dl_model = self.env['account.asset.line']
# Instance: Account settings
self.acs_model = self.env['account.config.settings']
values = {'fiscalyear_lock_date': "%s-12-31" % (date.today().year - 2)}
self.acs_model.create(values)
def test_1_linear_number(self):
"""Linear with Method Time 'Number'."""
asset = self.asset_model.create({