Hi guys,
I've created a custom module with two classes in one file. The first class inherits a model and adds fields, the second class creates a new model:
# -*- coding: utf-8 -*- from openerp import models, fields, api class aa_custom_module(models.Model): _inherit = 'fleet.vehicle' NumberPlate2 = fields.Char('Second number plate') SoortOpleggerIds = fields.Many2many('fleet.vehicle.oplegger.soort', 'fleet_soort_oplegger_rel', 'oplegger_oplegger_id', 'oplegger_id', 'Soort Oplegger', required=True) class fleet_oplegger_tag(models.Model): _name = 'fleet.vehicle.oplegger.soort' _description = 'Soort van oplegger' Name = fields.Char('Name', required=True, translate=True)
SoortOpleggerIds is a Many2many field which is defined as a widget for tags in the view:
<field name="SoortOpleggerIds" widget="many2many_tags"/>
The problem is that when I now want to create/add a new record to the Many2many SoortOpleggerIds I will get the following error:
2015-05-04 08:44:25,357 19326 WARNING test-db openerp.models: Cannot execute name_search, no _rec_name defined on fleet.vehicle.oplegger.soort
Thanks,
Yenthe