1. Safe eval domain before checking if it is defined. This makes [] be "False" on the first check, and provides the proper use case for when the domain is empty
2. Use filtered_domain in record instead of a search in self. When on a compute, we are on a NewId context, so the search would always fail
TT29309
- The name of the columns were swapped, so better to fix it for avoiding
mistakes due to this.
- Migration script for detecting the condition and swap column names.
- On v12 > v13 migration, include JOINs for avoiding FK constraint,
which `ON CONFLICT` clause doesn't protect.
Previous field declaration was incorrect due to a typo, leading to non applying the
company dependent features.
Now everything is correct and the migration scripts care of moving data properly.