Hi Zulsani,
This issue usually happens because of how the many2one field works in Odoo.
Why you're still seeing the old x_name values:
Even if you’ve deleted the records from Model A, the many2one field in Model B might still show them because:
-
The records may have been archived (soft-deleted), not permanently removed.
-
Some records in Model B may still be referencing those deleted entries.
What you can do:
1. Check if records in Model A are archived:
Go to the list view of Model A and apply the "Archived" filter under the Filters menu.
If you see any archived records, either delete them permanently or unarchive as needed.
2. Check existing records in Model B:
Open some records in Model B and see if the many2one field is still pointing to records that no longer exist in Model A.
You may need to manually clear or update those fields if they reference old data.
3. Use a domain filter to show only active records:
If you’re customising the many2one field, make sure to filter out inactive or deleted records. For example:
'field_name': fields.Many2one('model.a', domain=[('active', '=', True)]) (In Python file)
<field name="your_many2one_field" domain="[('active', '=', True)]"/>
(In XML file)