Impacted versions:

10.0

Steps to reproduce:

See  https://youtu.be/I3Qb3m1GmJ4

Current behavior:

Currency mixing in expense sheet view and report

Expected behavior:

Have no currency mixing :smile: 

Video/Screenshot link (optional):

See https://youtu.be/I3Qb3m1GmJ4

Credit : @alexis-via - Barcelona OCA code sprint


if any(sheet.employee_id != self[0].employee_id for sheet in self):
            raise UserError(_("Expenses must belong to the same Employee."))
        expense_lines = self.mapped('expense_line_ids')
        if expense_lines and any(expense.payment_mode != expense_lines[0].payment_mode for expense in expense_lines):
            raise UserError(_("Expenses must have been paid by the same entity (Company or employee)"))
    @api.model
    def create(self, vals):
        sheet = super(HrExpenseSheet, self).create(vals)
        self.check_consistency()
        if vals.get('employee_id'):
            sheet._add_followers()
        return sheet
    @api.multi
    def write(self, vals):
        res = super(HrExpenseSheet, self).write(vals)
        self.check_consistency()
        if vals.get('employee_id'):
            self._add_followers()
        return res
    @api.multi
    def unlink(self):
        for expense in self:
            if expense.state == "post":
                raise UserError(_("You cannot delete a posted expense."))
        super(HrExpenseSheet, self).unlink()
    @api.multi
    def set_to_paid(self):