Thanks for your help.
I try it but maybe I'm doing something wrong. I attach the whole code of my class.
Code:
class easypms_project(osv.osv):
def total_project_cost(self, cr, uid, ids, fields, arg, context=None):
x={}
for record in self.browse(cr, uid, ids):
x[record.id] = 5
return x
_name = 'easypms.project'
_columns = {
'name': fields.char('Project Name', size=255),
'category':fields.many2one('easypms.project_category', 'Κατηγορία'),
'cost': fields.float('Συμφωνημένο Κόστος',digits=(12,2)),
'cost_sum': fields.function(total_project_cost, method = True, type = 'integer', String='Συνολικό Κόστος Project')
'customer_id': fields.many2one('res.partner', 'Πελάτης'),
'task_of_project': fields.one2many('easypms.task','project_id','Λίστα task του project'),
'renewal_of_project': fields.one2many('easypms.renewal','project_id','Λίστα ανανεώσεων του project'),
'date_start': fields.datetime('Ημερομηνία Έναρξης'),
'date_finish': fields.datetime('Ημερομηνία Παράδοσης'),
'notes': fields.text('Περιγραφή'),
'status': fields.many2one('easypms.status', 'Κατάσταση'),
}
easypms_project()
Please ignore any other field and help me to resolve the problem of functional field.
When I try to save these changes and try to login to openerp, the system raise an error that the user or password is incorrect. But I'm sure that is correct because when I comment the code with the function, I can login.