Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0 & 17.0] hr_expense_invoice error when expense report includes invoices from diferent providers #273

Open
TheCloneMaster opened this issue Oct 18, 2024 · 1 comment · May be fixed by #276
Labels

Comments

@TheCloneMaster
Copy link

Module

hr_expense_invoice

Describe the bug

If an expense report includes invoices from diferent providers, when posting move the report moves to "paid" and invoices are not reconciled as paid.

To Reproduce

Affected versions: 16.0 & 17.0

Steps to reproduce the behavior:

  1. Create vendor bill for "provider 1"
  2. Create vendor bill for "provider 2"
  3. Create expense report, one line for bill created for provider 1 and another line for provider 2
  4. Approve and post expense report
    As a result, the expense report is marked as paid, and the invoices remain open

Expected behavior
The Expense report should move to "register payment", and the original invoices should appear as "paid"

@TheCloneMaster
Copy link
Author

The error is in _do_create_moves on hr_expense_sheet.py.
line 40 asks for the wrong vendor id...
== self.expense_line_ids.invoice_id.partner_id

it should be
== expense.invoice_id.partner_id

so that it takes the partner_id of current expense, not the one from the first expense from the report

I will upload a PR

Regards,
-Mario

TheCloneMaster added a commit to TheCloneMaster/hr-expense that referenced this issue Oct 21, 2024
If an expense report includes invoices from different providers,
when posting move the report moves to "paid" and invoices are not
reconciled as paid, as it fails to reconcile the lines with the
transfer moves.

Use the correct partner, from current expense line from the report,
not always the same partner from first expense line.

Fixes OCA#273
@TheCloneMaster TheCloneMaster linked a pull request Oct 21, 2024 that will close this issue
pedrobaeza pushed a commit to TheCloneMaster/hr-expense that referenced this issue Oct 21, 2024
If an expense report includes invoices from different providers,
when posting move the report moves to "paid" and invoices are not
reconciled as paid, as it fails to reconcile the lines with the
transfer moves.

Use the correct partner, from current expense line from the report,
not always the same partner from first expense line.

Fixes OCA#273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant