[REF] create a good registration with more arguments
bzr revid: mva@openerp.com-20120208155253-qz861vu0bbvkxpkn
This commit is contained in:
@@ -47,7 +47,17 @@ class sale_order_line(osv.osv):
|
||||
def button_confirm(self,cr,uid,ids,context=None):
|
||||
registration = self.browse(cr,uid,ids,context=None)
|
||||
for registration in registration:
|
||||
self.pool.get('event.registration').create(cr,uid,{'name':registration.product_id.name,'nb_register':1,'event_id':registration.event.id})
|
||||
self.pool.get('event.registration').create(cr,uid,{
|
||||
'name':registration.order_id.partner_invoice_id.name,
|
||||
'partner_id':registration.order_id.partner_id.id,
|
||||
'email':registration.order_id.partner_id.email,
|
||||
'phone':registration.order_id.partner_id.phone,
|
||||
'street':registration.order_id.partner_invoice_id.street,
|
||||
'city':registration.order_id.partner_invoice_id.city,
|
||||
'origin':registration.order_id.name,
|
||||
'nb_register':1,
|
||||
'event_id':registration.event.id,
|
||||
})
|
||||
return super(sale_order_line, self).button_confirm(cr, uid, ids, context)
|
||||
|
||||
sale_order_line()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after">
|
||||
<field name="product_id" on_change="onchange_product(product_id)"/>
|
||||
<field name="event_type"/>
|
||||
<field name="event_type" invisible="1"/>
|
||||
<field name="event" domain="[('type', '=', event_type )]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user