[18.0][MIG] hr_expense_invoice: Migration to version 18.0#308
Conversation
1222edd to
b683208
Compare
|
/ocabot migration hr_expense_invoice |
pedrobaeza
left a comment
There was a problem hiding this comment.
Please check also the issue #302 if it's happening here as well, and you may want to fix it in all the versions.
| expense_sheets_with_invoices = self.get_expense_sheets_with_invoices() | ||
| own_account_sheets = self.filtered( | ||
| lambda sheet: sheet.payment_mode == "own_account" | ||
| and not sheet.advance_sheet_id |
There was a problem hiding this comment.
This can't be put here, as it belongs to other module AFAIK.
|
Hello,
Le me know please, when I can test again. Thank you! |
rafaelbn
left a comment
There was a problem hiding this comment.
Tested and founded a but 🔴 . Please review it. thank you very much!
Set supplier invoices on HR expenses ==================================== This module should be used when a supplier invoice is paid by an employee. It allows to set a supplier invoice for each expense line, adding the corresponding journal items to transfer the debt to the employee. Installation ============ Install the module the regular way. Configuration ============= You don't need to configure anything more to use this module. Usage ===== Instead of coding a full expense line, select an existing supplier invoice, and then the rest of the fields will be auto-filled and grayed. When you generate the expenses account entries, lines with invoices filled will be generated as opposite of the payable move line of the invoice, and both will be reconciled, letting the employee payable account as the only open balance. Known issues / Roadmap ====================== * Multiple payment terms for a supplier invoice are not handled correctly. * Partial reconcile supplier invoices are also not correctly handled. OCA Transbot updated translations from Transifex
…se view OCA Transbot updated translations from Transifex
…l amount (OCA#237) On the same expense, when we have 2 or more lines with different invoices, and each invoices have the same total amount, reconcile is not possible. The fix is to exclude reconcile account.move.line, and the first time if we have more than one line to reconcile on the same amount, we keep the first. OCA Transbot updated translations from Transifex
OCA Transbot updated translations from Transifex
[UPD] Update hr_expense_invoice.pot
Currently translated at 100.0% (4 of 4 strings) Translation: hr-11.0/hr-11.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-11-0/hr-11-0-hr_expense_invoice/de/ Update translation files Updated by Update PO files to match POT (msgmerge) hook in Weblate.
[UPD] Update hr_expense_invoice.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-12.0/hr-12.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_invoice/
Add expense info to invoice info or create/edit
From expense sheet, add action "Create Invoice" from multiple expenses Change the way reference invoice_id is checked. - No more onchange invoice_id that set values to expense - Instead, check amount on expense and invoice during post entry - Change the way to allow reconcile with > 2 account move lines
Currently translated at 100.0% (4 of 4 strings) Translation: hr-12.0/hr-12.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_invoice/de/
Currently translated at 100.0% (4 of 4 strings) Translation: hr-12.0/hr-12.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_invoice/es/ [UPD] README.rst [UPD] Update hr_expense_invoice.pot [UPD] README.rst hr_expense_invoice 12.0.1.3.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-12.0/hr-12.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_invoice/
hr_expense_invoice 12.0.1.3.1
[UPD] Update hr_expense_invoice.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-expense-13.0/hr-expense-13.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-expense-13-0/hr-expense-13-0-hr_expense_invoice/ Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-expense-13.0/hr-expense-13.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-expense-13-0/hr-expense-13-0-hr_expense_invoice/
If not, the total amount of the expense won't match to invoices with taxes. [UPD] README.rst
[UPD] README.rst hr_expense_invoice 13.0.1.1.0
|
Hi Jordi,
Thanks for double-checking. On my side, when the vendor bill is still in
Draft I do get the expected warning when trying to post the expense, so
that path looks correct. In the attached expense, however, the Vendor Bill
field shows “Draft bill” while the expense ended up posted.
My recollection is that I clicked “Create Vendor Bill” and then clicked
“Post” on the expense without posting the bill first, and it auto-confirmed
at that moment. I can’t confirm it 100% and I don’t have reproducible
steps, but that’s what I remember from that record. If your current checks
are working as expected, I’m fine with that—sharing the expense just for
reference.
http://oca-hr-expense-18-0-pr308-5218e49283a0.runboat.odoo-community.org/odoo/expense-reports/14
El lun, 25 ago 2025 a las 16:11, Jordi Ballester Alomar (<
***@***.***>) escribió:
… *JordiBForgeFlow* left a comment (OCA/hr-expense#308)
<#308 (comment)>
@Gelojr <https://github.com/Gelojr> I cannot reproduce your error.
When I create a vendor bill from the expense report and is in draft:
image.png (view on web)
<https://github.com/user-attachments/assets/db48cd94-c0c4-4882-8118-fdb5d0f6bc83>
Then, before posting the bill I go to the expense report and try to Post
the journal entries I get the right error message:
image.png (view on web)
<https://github.com/user-attachments/assets/f85bd88c-cb9b-4d9e-bdde-05682b5ce548>
—
Reply to this email directly, view it on GitHub
<#308 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDFUBLRSFKU7RGD3IFHLAPD3PMKSRAVCNFSM6AAAAACAWJH6PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRQGQ3DMNJWGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@Gelojr I can reproduce the issue you mention when I create an expense report created with two expenses, where I only create a related invoice for one of them. Then I was able to post the expense report while keeping one of the vendor bill in draft. This is not an issue with the migration of the module, as this bug exists also in prior versions. The problem is here: https://github.com/OCA/hr-expense/blob/17.0/hr_expense_invoice/models/hr_expense_sheet.py#L21 and https://github.com/OCA/hr-expense/pull/308/files#diff-406b9f2af65ef4b7b24c6638a958cf7301ddad72e846bc1c68083c281238282dR15 The method Sould be using @david-banon-tecnativa do you agree? In any case we should handle this in a separate PR/Issue. |
|
Awesome, Jordi,
congrats on reproducing it! I didn’t remember the exact steps; I only
recall I managed to trigger it once. Great that you’ve identified it so it
can be fixed.
El lun, 25 ago 2025 a las 17:33, Jordi Ballester Alomar (<
***@***.***>) escribió:
… *JordiBForgeFlow* left a comment (OCA/hr-expense#308)
<#308 (comment)>
@Gelojr <https://github.com/Gelojr> I can reproduce the issue you mention
when I create an expense report created with two expenses, where I only
create a related invoice for one of them. Then I was able to post the
expense report while keeping one of the vendor bill in draft.
This is not an issue with the migration of the module, as this bug exists
also in prior versions. The problem is here:
https://github.com/OCA/hr-expense/blob/17.0/hr_expense_invoice/models/hr_expense_sheet.py#L21
.
The method
def get_expense_sheets_with_invoices(self):
return self.filtered(
lambda sheet: all(expense.invoice_id for expense in sheet.expense_line_ids)
)
Sould be using any not all
@david-banon-tecnativa <https://github.com/david-banon-tecnativa> do you
agree? In any case we should handle this in a separate PR/Issue.
—
Reply to this email directly, view it on GitHub
<#308 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDFUBLVIK4LJSRIFSCUJCNT3PMUD3AVCNFSM6AAAAACAWJH6PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRQG42TIMBVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Let's merge for now this one: /ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-308-by-pedrobaeza-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
|
@david-banon-tecnativa please rebase and check the failing CI. You can at the same time add a commit with the fix for the other problem. |
|
Hello @pedrobaeza , Is it a good idea merging this one with and existing bug?
Fixing the bug is not a choice? Do you have an idea how do you want to FIX it? Thank you! PD @Gelojr @ArantxaSudon take care so in:
|
|
Yes, the migration is correct as the problem is the same for all the versions, so you get at least the same module as in 17.0. Rest of the issues can be tackled in any moment. As now there's other problem, the fix may be included here, but you shouldn't block a migration because the discovering of a bug not related to the migration itself. |
…ot all being postable when invoices are in draft
5218e49 to
9acf553
Compare
|
I’ve updated the tests and implemented a fix for expense sheets that include one sheet with an unposted invoice and another with no invoice, ensuring an error is raised as it shouldn't be postable until the invoice is confirmed. |
Gelojr
left a comment
There was a problem hiding this comment.
Congrats on the work @david-banon-tecnativa given the reported issue also exists in prior versions and will be handled separately, I’m approving this PR. The following tests were executed and all passed:
- Test 1: Link an existing posted vendor bill to an expense and pay the report; transfer entries are created and the bill is reconciled -> OK.
- Test 2: Try to link a Draft vendor bill to an expense line; action is blocked with the expected warning -> OK.
- Test 3: Force an amount mismatch between the bill and the selected expenses; error is raised and posting/payment is blocked -> OK.
- Test 4: Attempt to change the total on a vendor bill linked to expenses; system prevents the change and keeps the original total -> OK.
- Test 5: Check smart buttons and counters to navigate between the expense report and the related vendor bill(s); links and counters work as expected -> OK.
- Test 6: Create a vendor bill from an expense report and, while the bill remains in Draft, attempt to post the expense report; warning appears and posting is blocked -> OK.
|
Sorry @rafaelbn you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
|
No need to bump version now for pip availability: /ocabot merge nobump |
|
On my way to merge this fine PR! |
|
Congratulations, your PR was merged at e5f0a33. Thanks a lot for contributing to OCA. ❤️ |
@Tecnativa @pedrobaeza @victoralmau
Superseedes #282 by @cav-adhoc while maintaining commit ownership.
I've made some minor adjustments, orignal PR looked good to me and only needed a rebase to work.
TT55529