Depending on the calling method, data can be something different from a dictionary
(like `None` if no keyword argument is provided), so this will crash. Example:
mis_builder is crashing in its tests.
We prevent that checking for a falsy value before trying to access the dictionary.
We also avoid context mangling for non AFR reports (those without the key
`account_financial_report_lang` in the dictionary), not callign to `with_context`
in that case.