Hi, sorry Iam new to odoo and python, so I have tree view with product history in the product equipment class which works fine but I want to also get first element value (product.history.customer) from the tree view but I have following error "ValueError: dictionary update sequence element #0 has length 1; 2 is required"
class product_history(osv.osv):
_name = 'product.history'
_description = 'product History'
_columns = {
'equipment_id': fields.many2one('product.equipment','Unit of work ref', required=True),
'customer': fields.many2one('res.partner', 'Customer',required=True),
'start_date': fields.date("Start Date"),
'end_date': fields.date("End Date"),
}
product_history()
class product_equipment(osv.osv):
_name = "product.equipment"
_description = "equipment"
_inherit = ['mail.thread','ir.needaction_mixin','product.history']
_columns = {
'main_location': fields.function(_last_name,type='many2one', string='Location', readonly = True),
}
def last_location(self, cr, uid, ids, field_name, arg, context=None):
return self.pool.get('product.history').browse(cr, uid, ids)
product_equipment()