Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hr_expense_invoice/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Supplier invoices on HR expenses",
"version": "16.0.2.0.3",
"version": "16.0.2.0.4",
"category": "Human Resources",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
Expand Down
10 changes: 9 additions & 1 deletion hr_expense_invoice/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2015-2024 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo import Command, _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools import float_compare

Expand Down Expand Up @@ -112,3 +112,11 @@ def action_view_invoices(self):
action["view_mode"] = "tree,form"
action["domain"] = [("id", "in", invoice_ids)]
return action

def _prepare_bill_vals(self):
ret = super(HrExpenseSheet, self)._prepare_bill_vals()
ret["line_ids"] = [
Command.create(expense._prepare_move_line_vals())
for expense in self.expense_line_ids.filtered(lambda r: not r.invoice_id)
]
return ret
Loading