Merge lp:~openerp-dev/openobject-addons/trunk-bug-1207194-cod into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1207194-cod
Merge into: lp:openobject-addons
Diff against target: 27 lines (+5/-2)
1 file modified
account_asset/wizard/account_asset_change_duration.py (+5/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1207194-cod
Reviewer Review Type Date Requested Status
Turkesh Patel (openERP) (community) Approve
Review via email: mp+192083@code.launchpad.net

Description of the change

Hello,

      I have fixed this issue,Traceback when we click on Change Duration button in Accounting -> Asset and also improved code to hide field.

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.
Revision history for this message
Turkesh Patel (openERP) (turkesh-tinyerp) :
review: Approve

Unmerged revisions

8952. By Chirag Dodiya(OpenERP)

[FIX]fixed traceback when click on Change Duration button

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_asset/wizard/account_asset_change_duration.py'
2--- account_asset/wizard/account_asset_change_duration.py 2013-05-21 12:23:59 +0000
3+++ account_asset/wizard/account_asset_change_duration.py 2013-10-22 05:29:20 +0000
4@@ -22,6 +22,7 @@
5 from lxml import etree
6
7 from openerp.osv import fields, osv
8+from openerp.osv.orm import setup_modifiers
9
10 class asset_modify(osv.osv_memory):
11 _name = 'asset.modify'
12@@ -55,12 +56,14 @@
13 if active_model == 'account.asset.asset' and asset_id:
14 asset = asset_obj.browse(cr, uid, asset_id, context=context)
15 doc = etree.XML(result['arch'])
16- if asset.method_time == 'number':
17+ if asset.method_time == 'number' and doc.xpath("//field[@name='method_end']"):
18 node = doc.xpath("//field[@name='method_end']")[0]
19 node.set('invisible', '1')
20- elif asset.method_time == 'end':
21+ setup_modifiers(node, result['fields']['method_end'])
22+ elif asset.method_time == 'end' and doc.xpath("//field[@name='method_number']"):
23 node = doc.xpath("//field[@name='method_number']")[0]
24 node.set('invisible', '1')
25+ setup_modifiers(node, result['fields']['method_number'])
26 result['arch'] = etree.tostring(doc)
27 return result
28

Subscribers

People subscribed via source and target branches

to all changes: