Modified code is as follows:
class person_code(osv.osv):
_name = 'person.code'
def _f_code(self, cr, uid, ids, context={}):
res = {}
for obj in self.browse(cr,uid,ids):
res[obj.id] = obj.code1 + obj.code2 + obj.code3
return res
_columns = {
'finalcode': fields.function(_f_code,type='char',string='Final
Code',size=32,readonly=True),
'code1': fields.char('code1',size=32),
'code2': fields.char('code2',size=32),
'code3': fields.char('code3',size=32),
}
person_code()
But, while saving the form, error occurred as:
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 633, in get
TypeError: _f_code() takes at most 5 arguments (6 given)
I dont know, where iam making mistake.
Thank you
-------------------- m2f --------------------
--
http://www.openobject.com/forum/viewtopic.php?p=41188#41188
-------------------- m2f --------------------
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users