I want to load a field value (batch_course_name) into a variable ( loadthefield ) inside a create method in order to use it as a prefix to a sequence field (name). I just don't know how to do that. Can you help me?
class intrac_batches(osv.osv):
def create(self, cr, uid, vals, context=None):
if not vals:
vals = {}
if context is None:
context = {}loadthefield = what to put here to load the value of the field batch_course_name
vals['name'] = loadthefield + self.pool.get('ir.sequence').get(cr, uid, 'intrac.batches.number')
return super(intrac_batches, self).create(cr, uid, vals, context=context)
_name = 'intrac.batches'
_columns = {
'name': fields.char('Batch Number'),'batch_course_name': fields.many2one('intrac.courses', 'Course'),
'
}
intrac_batches()