Bharat Devnani (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-939390-bde into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #939390 in OpenERP Addons: "Posting last depreciation line in the asset 
cause the asset to close"
  https://bugs.launchpad.net/openobject-addons/+bug/939390

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-939390-bde/+merge/116622

Hello, 

I have changed the condition in def create_move of 
account_asset/account_asset.py in order to keep the state 
in running, in case user post move of only last entry 
in depreciation lines.

Thanks & Regards,
Devnani Bharat R.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-939390-bde/+merge/116622
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-939390-bde.
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py	2012-07-18 12:27:30 +0000
+++ account_asset/account_asset.py	2012-07-25 11:20:34 +0000
@@ -366,8 +366,6 @@
         currency_obj = self.pool.get('res.currency')
         created_move_ids = []
         for line in self.browse(cr, uid, ids, context=context):
-            if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.remaining_value):
-                can_close = True
             depreciation_date = line.asset_id.prorata and line.asset_id.purchase_date or time.strftime('%Y-%m-%d')
             period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
             company_currency = line.asset_id.company_id.currency_id.id
@@ -419,6 +417,8 @@
             })
             self.write(cr, uid, line.id, {'move_id': move_id}, context=context)
             created_move_ids.append(move_id)
+            if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.asset_id.value_residual):
+               can_close = True
             if can_close:
                 asset_obj.write(cr, uid, [line.asset_id.id], {'state': 'close'}, context=context)
         return created_move_ids

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to