Browse Source

[FIX] Bug fixed asset deprec. date 'base_accounting_kit'

Ajmal JK 5 years ago
parent
commit
e11bc3c1db
  1. 2
      base_accounting_kit/__manifest__.py
  2. 5
      base_accounting_kit/doc/changelog.md
  3. 7
      base_accounting_kit/models/account_asset.py

2
base_accounting_kit/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Odoo 13 Full Accounting Kit',
'version': '13.0.3.4.2',
'version': '13.0.3.4.3',
'category': 'Accounting',
'summary': """ Asset and Budget Management,
Accounting Reports, PDC, Lock dates,

5
base_accounting_kit/doc/RELEASE_NOTES.md → base_accounting_kit/doc/changelog.md

@ -34,3 +34,8 @@
#### Version 13.0.3.4.2
#### FIX
- Bug Fixed reccuring payment templates.
#### 11.02.2020
#### Version 13.0.3.4.3
#### FIX
- Asset depreciation date issue

7
base_accounting_kit/models/account_asset.py

@ -264,7 +264,7 @@ class AccountAssetAsset(models.Model):
amount = amount_to_depr / self.method_number
if sequence == 1:
if self.method_period % 12 != 0:
date = datetime.strptime(self.date, '%Y-%m-%d')
date = datetime.strptime(str(self.date), '%Y-%m-%d')
month_days = \
calendar.monthrange(date.year, date.month)[1]
days = month_days - date.day + 1
@ -311,7 +311,6 @@ class AccountAssetAsset(models.Model):
return undone_dotation_number
def compute_depreciation_board(self):
print("compute_depreciatopn_board")
self.ensure_one()
posted_depreciation_line_ids = self.depreciation_line_ids.filtered(
@ -353,9 +352,9 @@ class AccountAssetAsset(models.Model):
self.date.year)) # e.g. 2018-12-31 +1 -> 2019
else:
asset_date = datetime.strptime(
self.date[:4] + '-01-01', DF).date()
str(self.date)[:4] + '-01-01', DF).date()
else:
asset_date = datetime.strptime(self.date[:7] + '-01',
asset_date = datetime.strptime(str(self.date)[:7] + '-01',
DF).date()
# if we already have some previous validated entries, starting date isn't 1st January but last entry + method period
if posted_depreciation_line_ids and \

Loading…
Cancel
Save