Daily updates from Odoo
Monday, May 25, 2026
1 change · saas-19.3
Resolved issues and error corrections
This update resolves a critical error that occurred during the migration of Malta taxes. The issue stemmed from missing tax XML IDs, which caused a script failure. The fix uses a validation check to ensure only existing tax records are added, preventing the migration from crashing.
Original PR description
### Issue: During migration of Malta taxes, the script can fail when certain tax XML IDs are missing for a company. If the XML ID does not exist, `env.ref(..., raise_if_not_found=False)` returns…
### Issue:
During migration of Malta taxes, the script can fail when certain tax XML IDs are missing for a company. If the XML ID does not exist, `env.ref(..., raise_if_not_found=False)` returns None. Trying to combine a recordset with None causes the migration to fail. Due to recent [commit]
### Traceback:
```py
tax_7 |= env.ref(f'account.{company.id}_VAT_S_IN_MT_7_G', raise_if_not_found=False)
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 6589, in __or__
return self.union(other)
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 6603, in union
raise TypeError(f"unsupported operand types in: {self} | {arg!r}")
TypeError: unsupported operand types in: account.tax() | None
```
###
Solution:
Use a guard check with the walrus operator (:=) to assign and validate the tax record before union.
This ensures that only existing tax records are added to the recordset, preventing the crash.
Ticket [link1](https://www.odoo.com/odoo/project.task/6159300) [link2](https://www.odoo.com/odoo/project.task/6149387)
opw-6159300
opw-6149387
Forward-Port-Of: odoo/odoo#264327