[IMP] website_event: on_change product

bzr revid: chm@openerp.com-20130806144536-6l2g1glui1cout2q
This commit is contained in:
Christophe Matthieu
2013-08-06 16:45:36 +02:00
parent dc0148b73e
commit cf82d597f2
3 changed files with 4 additions and 2 deletions
+3
View File
@@ -25,6 +25,9 @@ class event_product(osv.osv):
'qty': fields.integer('Current Registrations', readonly=True),
'max_qty': fields.integer('Maximum Registrations'),
}
def onchange_product_id(self, cr, uid, ids, product_id=False, context=None):
return {'value': {'price': self.pool.get("product.product").browse(cr, uid, product_id).list_price or 0}}
class product(osv.osv):
_inherit = 'product.product'
+1 -1
View File
@@ -12,7 +12,7 @@
<page string="Tarifs">
<field name="product_ids">
<tree string="Payments" editable="bottom">
<field name="product_id"/>
<field name="product_id" on_change='onchange_product_id(product_id)'/>
<field name="deadline"/>
<field name="price"/>
<field name="max_qty"/>
-1
View File
@@ -200,7 +200,6 @@ class Ecommerce(http.Controller):
values = website.get_rendering_context()
context = {}
order_obj = request.registry.get('sale.order')
order_line_obj = request.registry.get('sale.order.line')
user_obj = request.registry.get('res.users')