If you want unique sequence No. in farmer id then you can use sequence.
otherwise your code is fine.
_defaults = {
'name': lambda obj, cr, uid, context:
obj.pool.get('person.unique').farmer_seq_get(cr, uid),}
your create method should be like this.
def create(self, cr, user, vals, context=None):
vals['name'] = vals['stat'] + vals['dist'] +
vals['name']
return super(person_unique,self).create(cr, user, vals,
context)
In write you have to check if stat and dist exist in vals or not.
vals.get('stat',False) If not exist then use old one.
------------------------
OpenERP=Easier, Adaptable, Affordable, Modular
-------------------- m2f --------------------
--
http://www.openobject.com/forum/viewtopic.php?p=40531#40531
-------------------- m2f --------------------
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users