I tried with:
class Notification(metaclass=PoolMeta):
__name__ = 'notification.email'
@classmethod
def __setup__(cls):
super().__setup__()
for field in [
'recipients',
'recipients_secondary',
'recipients_hidden',
]:
field = getattr(cls, field)
print(field.domain)
But this is the domain defined on the fields:
[('model.model', '=', Eval('model', '')), ['OR', ('relation', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee']), [('model.model', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee']), ('name', '=', 'id')]], ['OR', ('relation', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee', 'company.company']), [('model.model', 'in', ['res.user', 'party.party', 'party.contact_mechanism', 'company.employee', 'company.company']), ('name', '=', 'id')]]]
As you see the relation models are included multiple times, one of them is missing the custom model (company.company
) thus the code fails because the domain is applied.