79707409

Date: 2025-07-19 16:49:37
Score: 0.5
Natty:
Report link

domain="[('id', 'in', duplicate_ids)]"

duplicates = self.env['hr.applicant'].with_context(active_test=False).search(domain)

Ensure the widget context does not override active_test=False implicitly. Currently, your field looks like this<field name="selected_duplicate_id" widget="many2one" options="{'no_create': True, 'no_open': True}" context="{'active_test': False, 'hr_force_show_archived': True, 'search_default_duplicates': True}" domain="[('id', 'in', duplicate_ids)]" class="oe_inline w-100"/>

You are very close — your backend logic is correct. The final fix likely lies in ensuring the context is properly passed into name_search() from the form, and confirming that duplicate_ids truly includes inactive records at runtime.

Would you like help checking your _get_similar_applicants_domain() method too? Sometimes the filter (‘active’, ‘in’, [True, False]) might be missing there.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: hema kukalakuntla