Hi, am unable to get movie names in field.many2one.
class tickets(osv.osv):
_name = 'tickets.book'
_description = 'tickets'
_columns={
'movie':fields.selection([('1', 'X-Men'),('2', 'Transporter'),('3', 'Salt'),('4', 'Taken')],'Movie Title',required=True),
'date':fields.date('Date',required=True),
'x_seat':fields.integer('Seats:',size=128,required=True),
'theater':fields.selection([('imax', 'Imax'),('inox','Inox'),('pvr','Pvr')],'Theater',required=True),
'time':fields.selection([('10:00am', 'Morning Show'),('06:00Pm', 'First Show')],'Time',required=True),
}
class tickets_amount(osv.osv):
_name = 'tickets.amount'
_description = 'tickets amount'
def _sel_func(self, cr, uid, context=None):
obj = self.pool.get('tickets.book')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['name', 'id'], context)
res = [(r['id'], r['name']) for r in res]
return res
_columns={
'date':fields.date('Date',required=True),
'x_amount':fields.float('Amount',required=True),
'movie':fields.many2one('tickets.book','Movie',required=True),
}