Skip to content
Snippets Groups Projects
Commit a339caa2 authored by Nasreddin Boulif (bon)'s avatar Nasreddin Boulif (bon)
Browse files

[FIX] hr_expense: display right error if no employee found


Steps to reproduce:

  - Install `Expenses` module
  - Go to Settings > Technical > Email > Aliases
  - Edit the `expense` alias
  - Ensure the model is `Expense`
  - Set `Alias Contact Security` to `Everyone`, then save

  - Send an e-mail to the expense alias, using an e-mail address not
    referenced on one of the employees.

Issue:

  Error in logs related to `currency` variable.

Cause:

  Trying to create an expense for a non-existing user, therefore,
  no currency is set.

Solution:

  If no user is found, no need to create the expense and let the orm
  raise the error that a required field is not set (field employee on
  expense).

opw-3027350

closes odoo/odoo#105771

Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
parent f72a7493
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment