Merge lp:~openerp-dev/openobject-addons/trunk-bug-997141-cha into lp:openobject-addons

Proposed by Ajay Chauhan(OpenERP)
Status: Merged
Approved by: Harry (OpenERP)
Approved revision: 6867
Merged at revision: 7920
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-997141-cha
Merge into: lp:openobject-addons
Diff against target: 41 lines (+7/-3)
1 file modified
account_asset/account_asset.py (+7/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-997141-cha
Reviewer Review Type Date Requested Status
Harry (OpenERP) (community) Approve
Ajay Chauhan(OpenERP) (community) Needs Resubmitting
Mustufa Rangwala (Open ERP) (community) Needs Fixing
Purnendu Singh (OpenERP) (community) Needs Fixing
Review via email: mp+108553@code.launchpad.net

Description of the change

Hello,
    i have made changes in calculation of residual amount to solve the bug.

Thanks,
Ajay Chauhan

To post a comment you must log in.
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote :

Hello ajay,

I don't think this code is working fine.

we need not to check a condition if posted_depreciation_line_ids: inside for x in range(len(posted_depreciation_line_ids), undone_dotation_number):

line 18 of your patch seems too static as is will always check for the index [0]!!

Please update your branch with latest trunk :)

Thanks,
Purnendu Singh

review: Needs Fixing
6864. By Ajay Chauhan(OpenERP)

[IMP] account_asset: revert old changes

6865. By Ajay Chauhan(OpenERP)

[MERGE] merge with main addons

6866. By Ajay Chauhan(OpenERP)

[IMP] account_asset: fixed depriciation board calculation problem

Revision history for this message
Ajay Chauhan(OpenERP) (cha-tinyerp) wrote :

Hello Sir,
        I modified code to solve the bug. Kindly review the code.

Thanks,
Ajay Chauhan

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

After removing rounding from the residual value method when I finish all the depreciation and check the residual it does not become 0.

Thanks,
Mustufa

review: Needs Fixing
6867. By Ajay Chauhan(OpenERP)

[IMP] account_asset: fix the issue of residual value

Revision history for this message
Ajay Chauhan(OpenERP) (cha-tinyerp) wrote :

Hello Sir,

    I have fixed the issue of not getting proper residual value when finish all depreciation. Kindly review this.

Thanks,
Ajay Chauhan

review: Needs Resubmitting
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

it's seem ok.

Thanks

review: Approve
6868. By Harry (OpenERP)

[MERGE]

6869. By Harry (OpenERP)

[IMP] account_asset: comment

6870. By Cedric Snauwaert (OpenERP)

[MERGE]merge with latest addons_trunk

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-07-19 07:31:36 +0000
3+++ account_asset/account_asset.py 2012-08-28 09:24:20 +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+ currency_obj = self.pool.get('res.currency')
9 for asset in self.browse(cr, uid, ids, context=context):
10 if asset.value_residual == 0.0:
11 continue
12@@ -158,6 +159,9 @@
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+ company_currency = asset.company_id.currency_id.id
17+ current_currency = asset.currency_id.id
18+ amount = currency_obj.compute(cr, uid, current_currency, company_currency, amount, context=context)
19 residual_amount -= amount
20 vals = {
21 'amount': amount,
22@@ -189,7 +193,7 @@
23
24 def _amount_residual(self, cr, uid, ids, name, args, context=None):
25 cr.execute("""SELECT
26- l.asset_id as id, round(SUM(abs(l.debit-l.credit))) AS amount
27+ l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount
28 FROM
29 account_move_line l
30 WHERE
31@@ -347,8 +351,8 @@
32 'sequence': fields.integer('Sequence', required=True),
33 'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
34 'parent_state': fields.related('asset_id', 'state', type='char', string='State of Asset'),
35- 'amount': fields.float('Depreciation Amount', required=True),
36- 'remaining_value': fields.float('Amount to Depreciate', required=True),
37+ 'amount': fields.float('Depreciation Amount', digits_compute=dp.get_precision('Account'), required=True),
38+ 'remaining_value': fields.float('Amount to Depreciate', digits_compute=dp.get_precision('Account'),required=True),
39 'depreciated_value': fields.float('Amount Already Depreciated', required=True),
40 'depreciation_date': fields.char('Depreciation Date', size=64, select=1),
41 'move_id': fields.many2one('account.move', 'Depreciation Entry'),

Subscribers

People subscribed via source and target branches

to all changes: