Hello hda,

Thank you for ur reply.

I modified the code as u said 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 + 

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()

but while saving, error occurred as follows.

Environment Information : 
System : Windows-XP-5.1.2600-SP2
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : en_US.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.2
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 
86, in _f_code
TypeError: coercing to Unicode: need string or buffer, int found


Thank you




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=41491#41491

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to