From 0db52fa2f169537a5e7d21ef2ddb231108cb55b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 4 Aug 2016 14:10:29 +0200 Subject: [PATCH] [FIX] account_asset: fix computation of default value _get_asset_method returns None as it sets a value on a recordset. What we do here is simply copying the computation directly in the default get to have a correct value instead of None. This has probably been introduced when migrating the module at the new API at commit 6120babb4569cb846dacaae885cd2ba27f587d06. --- addons/account_asset/wizard/account_asset_change_duration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_asset/wizard/account_asset_change_duration.py b/addons/account_asset/wizard/account_asset_change_duration.py index 8564968434c..cbfc01a58bf 100644 --- a/addons/account_asset/wizard/account_asset_change_duration.py +++ b/addons/account_asset/wizard/account_asset_change_duration.py @@ -54,7 +54,8 @@ class AssetModify(models.TransientModel): if 'method_end' in fields and asset.method_time == 'end': res.update({'method_end': asset.method_end}) if self.env.context.get('active_id'): - res['asset_method_time'] = self._get_asset_method_time() + asset = self.env['account.asset.asset'].browse(self.env.context.get('active_id')) + res['asset_method_time'] = asset.method_time return res @api.multi