I have a field many2many and in a specific view I need to show it as a many2one, or imitate the behavior of the many2one fields (restrict that only one record can be added and if the user select another record, the one that had previously selected will be deleted). In the view I declared:
<field name="employee_ids" widget="many2one" />
but it gave me the following error:
TypeError: 'int' object is not iterable
Is there any way to achieve this?
<field name="employee_ids" widget="selection" />
it will allow to select only one record. – HeroicMany2one
field? What is requiring you to useMany2many
? Or is this an already existing field and not a custom field? – travisw