The method _notify_get_groups is called to determine how a user should be
notified based on the groups he belongs to.
If a record is shared via portal but the model does not have a field named
`partner_id`, the method was failing.
With this patch, the presence of the field is checked first. No additional
access_token is computed if the field is not present.
Forward port of #59123closesodoo/odoo#59310
X-original-commit: 6612c7ae766e996c57bda5c4c23132797f162f1e
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>