Skip to content

Commit

Permalink
[FIX] account_asset: inconsistencies deferred revenues and assets
Browse files Browse the repository at this point in the history
The following configuration leads to different results:
- Deferred revenue: 12 entries, 1/month, prorata temporis, 1000€,
  date 15th of October
- Asset: 12 entries, 1/month, prorata temporis, 1000€, linear, date
  15th of October

Deferred revenues and assets should give identical results.

opw-690034
  • Loading branch information
nim-odoo committed Oct 17, 2016
1 parent b14c8b3 commit ea53259
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/account_asset/account_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _compute_board_amount(self, sequence, residual_amount, amount_to_depr, undon
else:
if self.method == 'linear':
amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
if self.prorata and self.category_id.type == 'purchase':
if self.prorata:
amount = amount_to_depr / self.method_number
if sequence == 1:
days = (self.company_id.compute_fiscalyear_dates(depreciation_date)['date_to'] - depreciation_date).days + 1
Expand All @@ -147,7 +147,7 @@ def _compute_board_undone_dotation_nb(self, depreciation_date, total_days):
while depreciation_date <= end_date:
depreciation_date = date(depreciation_date.year, depreciation_date.month, depreciation_date.day) + relativedelta(months=+self.method_period)
undone_dotation_number += 1
if self.prorata and self.category_id.type == 'purchase':
if self.prorata:
undone_dotation_number += 1
return undone_dotation_number

Expand Down

0 comments on commit ea53259

Please sign in to comment.