From 499853e273e94e553fa45d89981ddea4cd618ed5 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 25 Feb 2020 14:35:01 +0000 Subject: [PATCH] [FIX] hr_expense: Email creation for Expense MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Let's consider an expense product P with internal reference = 1 and sales price = 100€ - Let's consider an employee E with a work email address W - Configure your domain alias as odoo.com - Configure the expense alias as expense - Send an email from W to expense@odoo.com with '1 P 100' as subject Bug: An expense had been created for E with P as product and 0€ as price opw:2191939 closes odoo/odoo#46314 X-original-commit: bde7d4ecb2b4e7954753ff932467ce5618720580 Signed-off-by: Simon Goffin (sig) --- addons/hr_expense/models/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 0874911ddea..30609550592 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -561,7 +561,7 @@ class HrExpense(models.Model): product_code = expense_description.split(' ')[0] product = self.env['product.product'].search([('can_be_expensed', '=', True), ('default_code', '=ilike', product_code)], limit=1) if product: - expense_description = expense_description.replace(product_code, '') + expense_description = expense_description.replace(product_code, '', 1) return product, expense_description