Ujjvala Collins (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-876320-uco into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #876320 in OpenERP Addons: "Defining Asset Categories with Prorata 
Temporis"
  https://bugs.launchpad.net/openobject-addons/+bug/876320

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-876320-uco/+merge/79652

[FIX] account_asset:
-----------------------------------
* Fixed problem of category on change when creating asset from supplier invoice.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-876320-uco/+merge/79652
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-876320-uco.
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py	2011-09-15 16:50:00 +0000
+++ account_asset/account_asset.py	2011-10-18 07:11:25 +0000
@@ -296,6 +296,9 @@
         return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)
 
     def create(self, cr, uid, vals, context=None):
+        if vals.get('category_id'):
+            res = self.onchange_category_id(cr, uid, [], vals['category_id'], context=context)
+            vals.update(res['value'])
         asset_id = super(account_asset_asset, self).create(cr, uid, vals, context=context)
         self.compute_depreciation_board(cr, uid, [asset_id], context=context)
         return asset_id

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to