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


self.write({'state': 'approve', 'responsible_id': self.env.user.id})
    @api.multi
    def paid_expense_sheets(self):
        self.write({'state': 'done'})
    @api.multi
    def reset_expense_sheets(self):
        return self.write({'state': 'submit'})
    @api.multi
    def action_sheet_move_create(self):
        if any(sheet.state != 'approve' for sheet in self):
            raise UserError(_("You can only generate accounting entry for approved expense(s)."))
        if any(not sheet.journal_id for sheet in self):
            raise UserError(_("Expenses must have an expense journal specified to generate accounting entries."))
        expense_line_ids = self.mapped('expense_line_ids')\
            .filtered(lambda r: not float_is_zero(r.total_amount, precision_rounding=(r.currency_id or self.env.user.company_id.currency_id).rounding))
        res = expense_line_ids.action_move_create()
        if not self.accounting_date:
            self.accounting_date = self.account_move_id.date
        if self.payment_mode == 'own_account' and expense_line_ids:
            self.write({'state': 'post'})
        else:
            self.write({'state': 'done'})
        return res
    @api.multi
    def action_get_attachment_view(self):