odoo/odoo#262940

Created by fw-bot

Blocked

label
odoo-dev:saas-18.4-17.0-fix-lookup_xmlids-no-flush-523769-fw
head
6ccd59e4ca087c078a26b5504e89239862fb16da
odoo/odoo
17.0 #262791
18.0 #262899 missing r+
saas-18.2 #262920 missing r+
saas-18.3 #262934 missing r+
saas-18.4 #262940 missing statuses missing r+
19.0
saas-19.1
saas-19.2
saas-19.3
master

[FIX] base: _lookup_xmlids not flushing before executing SQL.

Steps to Reproduce:

Example:
In [1]: imd = self.env['ir.model.data']

In [2]: xml_id = self.env['ir.model.data'].search([], limit=1)

In [3]: imd._lookup_xmlids([xml_id.complete_name], self.env[xml_id.model])
Out[3]: [(18603, 'auth_signup', 'action_send_password_reset_instructions', 'ir.actions.server', 149, False, 149)]

In [4]: xml_id.write({'noupdate': not xml_id.noupdate})
Out[4]: True

In [5]: imd._lookup_xmlids([xml_id.complete_name], self.env[xml_id.model])
Out[5]: [(18603, 'auth_signup', 'action_send_password_reset_instructions', 'ir.actions.server', 149, False, 149)]

In [6]: imd.flush_model()

In [7]: imd._lookup_xmlids([xml_id.complete_name], self.env[xml_id.model])
Out[7]: [(18603, 'auth_signup', 'action_send_password_reset_instructions', 'ir.actions.server', 149, True, 149)]

Issue:

Fix:

Forward-Port-Of: #262791