Skip to content

[18.0] [ADD] hr_expense_employee_payment#321

Open
Shide wants to merge 1 commit intoOCA:18.0from
moduon:18.0-hr_expense_vendor_bill
Open

[18.0] [ADD] hr_expense_employee_payment#321
Shide wants to merge 1 commit intoOCA:18.0from
moduon:18.0-hr_expense_vendor_bill

Conversation

@Shide
Copy link
Copy Markdown
Contributor

@Shide Shide commented Nov 24, 2025

Allow to pay employees for expense Vendor Bills

This module extends the expense functionality so that expenses sheets paid by employees,
which are actual Vendor Bills, can be paid to the employee.

To do this, an intermediate journal entry is created that transfers the debt
from the supplier to the employee and also modifies the payment wizard so that
the employee receives the payment. Partial payments are also compatible.

https://www.loom.com/share/76008e313b1140d5b21bd84793ed0c88

MT-12694 @moduon @rafaelbn @EmilioPascual please review if you want 😄

Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already an existing module for this: hr_expense_invoice. If there's something incorrect there, just fix it or propose the enhancement, not to do "another one".

@pedrobaeza pedrobaeza added this to the 18.0 milestone Nov 24, 2025
@Shide Shide force-pushed the 18.0-hr_expense_vendor_bill branch from f64a057 to 5848b07 Compare November 25, 2025 10:35
@Shide Shide changed the title [18.0] [ADD] [WIP] hr_expense_vendor_bill [18.0] [ADD] hr_expense_vendor_bill Nov 25, 2025
@Shide Shide force-pushed the 18.0-hr_expense_vendor_bill branch 4 times, most recently from 56fde4f to dd2fc59 Compare November 26, 2025 08:13
@rafaelbn
Copy link
Copy Markdown
Member

@Shide the readme in not what the module do and could generate misunderstanding.

Odoo creates now bill always by default.

This modules is more hr_expense_employee_payment because this module makes you can pay the employee event when the bill created in core is of a vendor.

This modules is completely different to hr_expense_invoice but name and readme indicates they are the same.

Could you please change it?

Thank you!

Sorry for confusion @pedrobaeza

@pedrobaeza
Copy link
Copy Markdown
Member

OK, I don't fully understand what you mean, but I suppose you'll redo README and so on.

Copy link
Copy Markdown

@Gelojr Gelojr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations on the good work @Shide .
The following tests have been executed:

  • Test 1: Full payment of an expense report creates the correct reconciliation, the vendor bill is fully settled and the payment entry posts the employee payable account on debit against the bank account on credit.
  • Test 2: Full payment of an expense report using a payment method with a clearing account generates the correct entry posting the employee payable account on debit against the clearing account on credit.
  • Test 3: Partial payments correctly update the residual amount and payment state, ending as fully paid.
  • Test 4: Group payment for multiple expense reports of the same employee is correctly generated as a single grouped payment.
  • Test 5: Mixed employee-bill and vendor-bill expense reports correctly trigger the blocking error.
  • Test 6: Splitting an expense report in “Submitted” state works properly, generating one sheet per line.
  • Test 7: Attempting to split an approved expense report correctly raises the expected error.

Additionally, please consider as a potential improvement that expenses often use a non-deductible VAT tax. When converting them into vendor bills, users usually need to manually adjust the VAT. A warning or helper to review taxes could be very helpful.

@Shide
Copy link
Copy Markdown
Contributor Author

Shide commented Nov 27, 2025

Additionally, please consider as a potential improvement that expenses often use a non-deductible VAT tax. When converting them into vendor bills, users usually need to manually adjust the VAT. A warning or helper to review taxes could be very helpful.

This module doesn't impact on the creation or modifications on the Vendor/Employee Bills. It's not its goal, so I'm not going to change anything. This module just create the intermediate entry and adjust the payment wizard values to match Employee.

@Shide Shide force-pushed the 18.0-hr_expense_vendor_bill branch from dd2fc59 to e9579c3 Compare November 27, 2025 08:30
@Shide Shide changed the title [18.0] [ADD] hr_expense_vendor_bill [18.0] [ADD] hr_expense_employee_payment Nov 27, 2025
@Shide Shide requested a review from pedrobaeza November 27, 2025 08:31
Copy link
Copy Markdown
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Actually hr.expense.sheet create in core by default vendor bills always. This is what I mean, that its not needed to create them. So we don't create vendor bills in this module.

Take care: Odoo 19 hr.expense.sheet disappears in Odoo 19

I recorded the simple workflow: https://www.loom.com/share/a85b6754c4634b55b01b027787fef937

I liked it ❤️

We can take out from OCA if you still see it redundant.

Thank you!
Regards,
Rafael

Copy link
Copy Markdown

@EmilioPascual EmilioPascual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module works perfectly.

A few minor changes that do not affect behavior, such as using filtered_domain instead of filtered in simple filters, wich is faster. https://www.odoo.com/es_ES/forum/ayuda-1/what-is-the-difference-between-selffiltered-and-selffiltered-domain-258944

@Shide Shide force-pushed the 18.0-hr_expense_vendor_bill branch from 7407c03 to 3f85812 Compare December 12, 2025 12:21
@Shide
Copy link
Copy Markdown
Contributor Author

Shide commented Dec 12, 2025

Added the posibility to use a different (general) Journal on the Intermediate Entry (in case you use exclusive receipt journal) or want another one for other reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants