Add missing context check

Without this check it will fail if context is not passed.

See https://github.com/OCA/hr/pull/50/files#r21771498