I have two fields as shown below.
> appo_date = fields.Date(string="Appointment Date")
> appo_time = fields.Float(string="Appointment Time")
I need to concatenate this two fields. For that i wrote a function as shown below.
def _combine(self, cr, uid, ids, field_name, args, context=None): values = {} for id in ids: rec = self.browse(cr, uid, [id], context=context)[0] values[id] = {} values[id] = '%f - %f' % (rec.appo_date, rec.appo_time) return values
And called that function in a separate field as shown below.
appo_date_and_time = fields.Char(compute='_combine', string='Appointment Date/Time', arg=('appo_date','appo_time'), method=True)
These fields are called in xml files
<field name="appo_date"/> <field name="appo_time"/> <field name="appo_date_and_time"/>
I am getting an error as
TypeError: _combine() takes at least 6 arguments (5 given)