odoo/odoo#262940
Created by fw-bot
Blocked
- Merge method
- Review
-
CI
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: (runtime 1194s)
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n
- ci/documentation
- ci/design-theme
- 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:
- write on ir.model.data to modify noupdate.
- _lookup_xmlids still returns the old noupdate value.
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:
- _lookup_xmlids is returning values from ir.model.data executing an SQL query w/o flushing.
Fix:
- Add flushing in _lookup_xmlids.
Forward-Port-Of: #262791