diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-02-13 18:45:51 +0100 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-02-13 18:45:51 +0100 |
| commit | fdc7eee9b37f040c64d1a2cc96ef8e142423708e (patch) | |
| tree | 33256961a13318d27a6c6108ee4c78e3956057e9 /addons | |
| parent | 57ac1b0f0482f3121ed7b45b639d6ce2844c6b3b (diff) | |
| parent | 0a6f2417e797e7ade9699d4638f2786f581c6e9f (diff) | |
[MERGE] fix of bug 1078004
lp bug: https://launchpad.net/bugs/1078004 fixed
bzr revid: qdp-launchpad@openerp.com-20130213174551-uzu6jql330ejvguv
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account_asset/account_asset.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index b7330352b12..b335063b758 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -331,6 +331,9 @@ class account_asset_asset(osv.osv): depreciation_obj = self.pool.get('account.asset.depreciation.line') period = period_obj.browse(cr, uid, period_id, context=context) 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) + if context is None: + context = {} + context.update({'depreciation_date':period.date_stop}) return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context) def create(self, cr, uid, vals, context=None): @@ -388,7 +391,7 @@ class account_asset_depreciation_line(osv.osv): created_move_ids = [] asset_ids = [] for line in self.browse(cr, uid, ids, context=context): - depreciation_date = time.strftime('%Y-%m-%d') + depreciation_date = context.get('depreciation_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 current_currency = line.asset_id.currency_id.id |
