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
=== modified file 'lunch/lunch.py'
--- lunch/lunch.py 2013-04-04 09:52:57 +0000
+++ lunch/lunch.py 2013-08-13 07:21:13 +0000
@@ -131,23 +131,6 @@
131 alert_msg.append(alert.message)131 alert_msg.append(alert.message)
132 return '\n'.join(alert_msg)132 return '\n'.join(alert_msg)
133133
134 def onchange_price(self, cr, uid, ids, order_line_ids, context=None):
135 """
136 Onchange methode that refresh the total price of order
137 """
138 res = {'value': {'total': 0.0}}
139 order_line_ids = self.resolve_o2m_commands_to_record_dicts(cr, uid, "order_line_ids", order_line_ids, ["price"], context=context)
140 if order_line_ids:
141 tot = 0.0
142 product_ref = self.pool.get("lunch.product")
143 for prod in order_line_ids:
144 if 'product_id' in prod:
145 tot += product_ref.browse(cr, uid, prod['product_id'], context=context).price
146 else:
147 tot += prod['price']
148 res = {'value': {'total': tot}}
149 return res
150
151 def __getattr__(self, attr):134 def __getattr__(self, attr):
152 """ 135 """
153 this method catch unexisting method call and if it starts with136 this method catch unexisting method call and if it starts with
154137
=== modified file 'lunch/lunch_view.xml'
--- lunch/lunch_view.xml 2013-03-15 11:43:38 +0000
+++ lunch/lunch_view.xml 2013-08-13 07:21:13 +0000
@@ -335,7 +335,7 @@
335 <div name="preferences">335 <div name="preferences">
336 </div>336 </div>
337 <separator string='Select your order'/>337 <separator string='Select your order'/>
338 <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>338 <field name='order_line_ids' nolabel='1'>
339 <tree string='List' editable='bottom'>339 <tree string='List' editable='bottom'>
340 <field name='product_id' on_change='onchange_price(product_id)'/>340 <field name='product_id' on_change='onchange_price(product_id)'/>
341 <field name='note' />341 <field name='note' />

Subscribers

People subscribed via source and target branches

to all changes: