OdooMindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
if not self.env.context.get('default_employee_id'):
for expense in self:
expense.employee_id = self.env.user.with_company(expense.company_id).employee_id