Merge lp:~openerp-dev/openobject-addons/trunk-bug-1078004-jco into lp:openobject-addons

Proposed by Josse Colpaert (OpenERP)
Status: Merged
Merged at revision: 8551
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1078004-jco
Merge into: lp:openobject-addons
Diff against target: 22 lines (+4/-1)
1 file modified
account_asset/account_asset.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1078004-jco
Reviewer Review Type Date Requested Status
qdp (OpenERP) Pending
Review via email: mp+141080@code.launchpad.net

Description of the change

The period of the moves created by the compute assets wizard is now that of the chosen period. The date chosen is end of the month of that period.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py 2012-12-17 15:23:03 +0000
+++ account_asset/account_asset.py 2012-12-21 14:55:51 +0000
@@ -331,6 +331,9 @@
331 depreciation_obj = self.pool.get('account.asset.depreciation.line')331 depreciation_obj = self.pool.get('account.asset.depreciation.line')
332 period = period_obj.browse(cr, uid, period_id, context=context)332 period = period_obj.browse(cr, uid, period_id, context=context)
333 depreciation_ids = depreciation_obj.search(cr, uid, [('asset_id', 'in', ids), ('depreciation_date', '<=', period.date_stop), ('depreciation_date', '>=', period.date_start), ('move_check', '=', False)], context=context)333 depreciation_ids = depreciation_obj.search(cr, uid, [('asset_id', 'in', ids), ('depreciation_date', '<=', period.date_stop), ('depreciation_date', '>=', period.date_start), ('move_check', '=', False)], context=context)
334 if context is None:
335 context = {}
336 context.update({'depreciation_date':period.date_stop})
334 return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)337 return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)
335338
336 def create(self, cr, uid, vals, context=None):339 def create(self, cr, uid, vals, context=None):
@@ -388,7 +391,7 @@
388 created_move_ids = []391 created_move_ids = []
389 asset_ids = []392 asset_ids = []
390 for line in self.browse(cr, uid, ids, context=context):393 for line in self.browse(cr, uid, ids, context=context):
391 depreciation_date = time.strftime('%Y-%m-%d')394 depreciation_date = context.get('depreciation_date') or time.strftime('%Y-%m-%d')
392 period_ids = period_obj.find(cr, uid, depreciation_date, context=context)395 period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
393 company_currency = line.asset_id.company_id.currency_id.id396 company_currency = line.asset_id.company_id.currency_id.id
394 current_currency = line.asset_id.currency_id.id397 current_currency = line.asset_id.currency_id.id

Subscribers

People subscribed via source and target branches

to all changes: