hello,
Actually, i tried str(nxt_number) before posting the previous patch, but error
occurred.
I modified as follows:
class person_final(osv.osv):
_name = 'person.final'
def _f_code(self, cr, uid, ids, field_name, arg, context={}):
res = {}
for obj in self.browse(cr,uid,ids):
nxt_number = obj.code44.next_number + 1
res[obj.id] = obj.code11.name + obj.code22.name +
obj.code33.name + obj.code44.name +
str(nxt_number)
self.pool.get('person.code4').write(cr,uid,[obj.code44.id],
{'next_number':nxt_number})
return res
_columns = {
'finalcode':
fields.function(_f_code,type='char',method=True,string='Final Person
Code',size=32,readonly=True),
'code11':
fields.many2one('person.code1','Code1',size=32,required=True),
'code22': fields.many2one('person.code2','Code2',size=32),
'code33': fields.many2one('person.code3','Code3',size=32),
'code44': fields.many2one('person.code4','Code4',size=32),
}
person_final()
The error occurred was:
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call
last):
File "netsvc.pyo", line 240, in dispatch
File "netsvc.pyo", line 73, in __call__
File "service\web_services.pyo", line 583, in execute
File "osv\osv.pyo", line 59, in wrapper
File "osv\osv.pyo", line 119, in execute
File "osv\osv.pyo", line 111, in execute_cr
File "osv\orm.pyo", line 2054, in read
File "osv\orm.pyo", line 2165, in _read_flat
File "osv\fields.pyo", line 631, in get
File "C:\Program Files\OpenERP
AllInOne\Server\addons\personunique.zip\personunique\personuniqueid.py", line
88,
in _f_code
File "osv\orm.pyo", line 2323, in write
KeyError: 'next_number'
Thank you
-------------------- m2f --------------------
--
http://www.openobject.com/forum/viewtopic.php?p=41500#41500
-------------------- m2f --------------------
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users