Unable to create email templates from xml file
We have a custom module that creates a email template using and XML file. This template is defined as
<record model="ir.email.template" id="email_template_sale">
<field name="name">Test</field>
<field name="model" search="[('model', '=', 'sale.sale')]"/>
<field name="recipients"
search="[('model.model', '=', 'sale.sale'), ('name', '=', 'party')]"/>
</record>
When updating the module, I get a DomainValidationError on the recipients fields.
After some debugging I just found that the evaluated domain is:
[['model', '=', 196], ['OR', ['relation', 'in', ['res.user']], [['model.model', 'in', ['res.user']], ['name', '=', 'id']]], ['OR', ['relation', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee', 'web.user']], [['model.model', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee', 'web.user']], ['name', '=', 'id']]]]
I found this on 6.0 series.