Merge lp:~openerp-dev/openobject-addons/6.1-opw-574732-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Approved
Approved by: Vinay Rana (OpenERP)
Approved revision: 6795
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574732-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 31 lines (+6/-1)
1 file modified
account_asset/account_asset.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574732-ado
Reviewer Review Type Date Requested Status
Vinay Rana (OpenERP) (community) Approve
Xavier ALT Pending
Naresh(OpenERP) Pending
Review via email: mp+105444@code.launchpad.net

Description of the change

Hello,

"[FIX] : incorrect rounding for residual amount field"

Steps :
1. Create an asset , set Time method = Number of depreciations, Number of depreciations = 23, Period length = 1
2. Value of the asset: 1500
3. Compute the depreciation board the first Depreciation line = 65.22
4. Now confirm the asset
5. Validate the first depreciation line
6. Reset the asset to draft
7. Change the value of the asset to 2100 and Compute the depreciation board

PROBLEM 1: Second line in depreciation board there is a incorrect rounding for column Amount already depreciated": 65 instead of 65.22
PROBLEM 2: If you compute the column "Depreciation amount" we do not obtain 2100

Regards,
Amit

To post a comment you must log in.
6795. By Amit Dodiya<email address hidden>

[FIX] : incorrect rounding for residual amount field

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

The rounding issue is going to be solve by applying this patch.

review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-997141-cha/+merge/108553 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6795. By Amit Dodiya<email address hidden>

[FIX] : incorrect rounding for residual amount field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_asset/account_asset.py'
2--- account_asset/account_asset.py 2012-01-31 13:36:57 +0000
3+++ account_asset/account_asset.py 2012-05-11 09:34:18 +0000
4@@ -134,6 +134,7 @@
5
6 def compute_depreciation_board(self, cr, uid, ids, context=None):
7 depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')
8+ prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
9 for asset in self.browse(cr, uid, ids, context=context):
10 if asset.value_residual == 0.0:
11 continue
12@@ -158,6 +159,10 @@
13 for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
14 i = x + 1
15 amount = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
16+ asset.salvage_value = round(asset.salvage_value, prec)
17+ asset.purchase_value = round(asset.purchase_value, prec)
18+ residual_amount = round(residual_amount, prec)
19+ amount = round(amount, prec)
20 residual_amount -= amount
21 vals = {
22 'amount': amount,
23@@ -189,7 +194,7 @@
24
25 def _amount_residual(self, cr, uid, ids, name, args, context=None):
26 cr.execute("""SELECT
27- l.asset_id as id, round(SUM(abs(l.debit-l.credit))) AS amount
28+ l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount
29 FROM
30 account_move_line l
31 WHERE