Merge lp:~openerp-dev/openobject-addons/trunk-bug-1200208-jaydeep into lp:openobject-addons

Proposed by Jaydeep Barot(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1200208-jaydeep
Merge into: lp:openobject-addons
Diff against target: 40 lines (+1/-18)
2 files modified
lunch/lunch.py (+0/-17)
lunch/lunch_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1200208-jaydeep
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+179861@code.launchpad.net

Description of the change

Hello,

[trunk] remove the onchange_price method in lunch_order and remove event in field of order_line_ids.

Thanks,
Jaydeep Barot.

To post a comment you must log in.

Unmerged revisions

8853. By Jaydeep Barot(OpenERP)

[FIX] remove onchange event on field order_line_ids and remove this method in lunch order

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lunch/lunch.py'
2--- lunch/lunch.py 2013-04-04 09:52:57 +0000
3+++ lunch/lunch.py 2013-08-13 07:21:13 +0000
4@@ -131,23 +131,6 @@
5 alert_msg.append(alert.message)
6 return '\n'.join(alert_msg)
7
8- def onchange_price(self, cr, uid, ids, order_line_ids, context=None):
9- """
10- Onchange methode that refresh the total price of order
11- """
12- res = {'value': {'total': 0.0}}
13- order_line_ids = self.resolve_o2m_commands_to_record_dicts(cr, uid, "order_line_ids", order_line_ids, ["price"], context=context)
14- if order_line_ids:
15- tot = 0.0
16- product_ref = self.pool.get("lunch.product")
17- for prod in order_line_ids:
18- if 'product_id' in prod:
19- tot += product_ref.browse(cr, uid, prod['product_id'], context=context).price
20- else:
21- tot += prod['price']
22- res = {'value': {'total': tot}}
23- return res
24-
25 def __getattr__(self, attr):
26 """
27 this method catch unexisting method call and if it starts with
28
29=== modified file 'lunch/lunch_view.xml'
30--- lunch/lunch_view.xml 2013-03-15 11:43:38 +0000
31+++ lunch/lunch_view.xml 2013-08-13 07:21:13 +0000
32@@ -335,7 +335,7 @@
33 <div name="preferences">
34 </div>
35 <separator string='Select your order'/>
36- <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
37+ <field name='order_line_ids' nolabel='1'>
38 <tree string='List' editable='bottom'>
39 <field name='product_id' on_change='onchange_price(product_id)'/>
40 <field name='note' />

Subscribers

People subscribed via source and target branches

to all changes: