First we have to define the States
So to define states follow the below code.
columns = {
state: fields.selection([
(new,New),
(assigned,Assigned),
(negotiation,Negotiation),
(won,Won),
(lost,Lost)], Stage, readonly=True),
}
After that you can add States Fields (Object).
def mymod_new(self, cr, uid, ids):
self.write(cr, uid, ids, { 'state' : 'new' })
return True
def mymod_assigned(self, cr, uid, ids):
self.write(cr, uid, ids, { 'state' : 'assigned' })
return True
def mymod_negotiation(self, cr, uid, ids):
self.write(cr, uid, ids, { 'state' : 'negotiation' })
return True
def mymod_won(self, cr, uid, ids):
self.write(cr, uid, ids, { 'state' : 'won' })
return True
def mymod_lost(self, cr, uid, ids):
self.write(cr, uid, ids, { 'state' : 'lost' })
return True
0 Comment(s)