Skip to content

[ADD] hr_expense_vendor_bill#367

Open
max3903 wants to merge 1 commit into
OCA:18.0from
ursais:18-add-hr_expense_vendor_bill
Open

[ADD] hr_expense_vendor_bill#367
max3903 wants to merge 1 commit into
OCA:18.0from
ursais:18-add-hr_expense_vendor_bill

Conversation

@max3903

@max3903 max3903 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

Move hr_expense_vendor_bill from OCA/l10n-mexico#78 into the hr-expense repository where it belongs.

The module extends employee expenses paid with the employee's own account to:

  • Create vendor bills grouped by supplier
  • Register supplier payments automatically
  • Generate an employee reimbursement bill reconciled with those payments
  • Reset expense sheets to draft while cleaning up related journal entries and payments

Changes applied for hr-expense

  • Updated manifest website, category, and author for this repository
  • Credited Gray Matter Logic contributors
  • Includes unit tests, Spanish translations, demo data, and readme fragments

Related

Test plan

  • Install hr_expense_vendor_bill on Odoo 18.0
  • Configure reimbursement debit/credit accounts on the company
  • Create expenses with vendors on own account, approve and post the expense sheet
  • Verify supplier invoices, payments, and employee reimbursement are created and reconciled
  • Reset the expense sheet to draft and confirm related moves/payments are removed
  • Run module tests

Made with Cursor

@OCA-git-bot OCA-git-bot added series:18.0 mod:hr_expense_vendor_bill Module hr_expense_vendor_bill labels Jun 19, 2026
@max3903 max3903 force-pushed the 18-add-hr_expense_vendor_bill branch 3 times, most recently from 3129796 to aeed033 Compare June 19, 2026 14:30
Add module moved from OCA/l10n-mexico#78 to create vendor bills from
employee expenses paid on own account, register supplier payments, and
generate a reconciled employee reimbursement bill.

Only runs the custom flow when expense lines have a vendor set, so
standard own-account expense sheets keep default hr-expense behavior.
Includes unit tests for posting, payments, reconciliation, and error paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@max3903 max3903 force-pushed the 18-add-hr_expense_vendor_bill branch from aeed033 to e36ecd0 Compare June 19, 2026 14:38
@max3903

max3903 commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@hector-fe-dev @anibal-osi Can you review this pull request please?

@pedrobaeza

Copy link
Copy Markdown
Member

hr_expense_invoice was created for the same purpose. Why not use it?

@hector-fe-dev

hector-fe-dev commented Jun 19, 2026

Copy link
Copy Markdown

Already make a review and looks good to me.
I also compare it to hr_expense_invoice. They do function for the same purpose but have a somewhat different approach.

hr_expense_vendor_bill

User workflow

  1. Create expenses with Paid by: Employee and set Vendor on each line.
  2. Submit and approve the expense report.
  3. Post the expense report.

On approval, the module:

  • Clears any standard expense journal entries
  • Creates one draft vendor bill per supplier (grouped by vendor_id)
  • Creates a draft employee reimbursement vendor bill (partner = employee’s work contact)

On posting, it:

  1. Posts supplier vendor bills
  2. Registers outbound payments for those bills (prefers a bank journal named “Employee payments”)
  3. Posts the employee reimbursement bill
  4. Reconciles lines on the “Miscellaneous payables - employees” account
  5. Marks the expense sheet done

Meanwhile on hr_expense_invoice has two ways of how to be use

  1. Link an existing vendor bill to an expense line
    On each expense line, set Vendor Bill (invoice_id) to a posted, unpaid vendor bill that isn’t already linked to another expense.

The expense amount, currency, date, and taxes are driven from the invoice.

  1. Create a vendor bill from the expense
    On an approved expense report, use “Create Vendor Bill” per line. That:

Creates a draft in_invoice from the expense data
Copies attachments from the expense to the invoice
Links the new bill to the expense line
You then post/validate the vendor bill and continue the expense flow.

I would suggest that both cases could be combine into one module eventually

@anibal-osi

Copy link
Copy Markdown

Hi everyone!
@max3903 I reviewed the module and tested the main workflow locally.

I agree that hr_expense_invoice and this module are related and partially overlap in purpose, but I do not think they cover the exact same use case.

So, I agree with the previous comment that both modules could eventually be reviewed together, either to reduce overlap or to share common logic where it makes sense.

The implementation looks consistent to me.

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

Labels

mod:hr_expense_vendor_bill Module hr_expense_vendor_bill series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants