[FIX] hr_expense: expense name on pdf upload
When uploading a PDF, the expense name is showing the 1st category of expense instead of the name of the PDF. opw-3339756 closes odoo/odoo#123608 X-original-commit: 7ec2bb68067e49ea5ab2bbd6598264ccb78cfd70 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -349,8 +349,9 @@ class HrExpense(models.Model):
|
||||
raise UserError(_("You need to have at least one category that can be expensed in your database to proceed!"))
|
||||
|
||||
for attachment in attachments:
|
||||
attachment_name = '.'.join(attachment.name.split('.')[:-1])
|
||||
expense = self.env['hr.expense'].create({
|
||||
'name': product.display_name,
|
||||
'name': attachment_name,
|
||||
'unit_amount': 0,
|
||||
'product_id': product.id,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user