[19.0][MIG] hr_expense_invoice: Migration to 19.0#357
Draft
dnplkndll wants to merge 66 commits into
Draft
Conversation
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
… partners. - Intercept properly the sheet paid action for not marking it as paid when reconciling the expense lines that belongs to invoices. - Prevent set invoices paid when sheet paid by company. - Some docstring. Co-authored-by: Pedro M. Baeza <pedro.baeza@tecnativa.com> Co-authored-by: Víctor Martínez <victor.martinez@tecnativa.com> hr_expense_invoice 13.0.1.1.2 [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/
…ing to sheet hr_expense_invoice 13.0.1.2.0 [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/
…ent models (hr.expense.create.invoice)
…ted with expense and improve domain to prevent set same invoice in different expenses.
…e is set) hr_expense_invoice 13.0.1.3.0 [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/
Currently translated at 100.0% (15 of 15 strings) Translation: hr-expense-16.0/hr-expense-16.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_invoice/it/
- The resulting entries after posting were not correct. Now, this is
handled this way:
* Paid by the company: no entry is created, as the invoice represents
the AP balance. The expense sheet payment state is controlled
through the linked invoices payment states.
* Paid by employee: the vendor bill that core creates is voided, and
instead, a journal entry transferring the AP balance to the employee
is created against the original vendor balance, that is reconciled
and given as paid.
- When an invoice is selected in the expense, the interface was not
properly adapted, avoiding to change certain data, and the
corresponding were not filled as well. Now both things are performed.
- Removed the non-sense register payment constraint.
- Added smart-button to navigate from invoice to expense, as there's
no visible link in that direction.
- Avoid the need of the field `with_invoice_id`, as it was simply a
question of putting properly the other field as invisible and without
groups (apart from the already existing one with groups).
- Payment state and residual amount controlled correctly for these new
cases.
- Tests cleanup, adapted (they were manipulated in some cases to match
the weird previous result, like in payment states) and redundancies
were removed.
TT49143
Currently translated at 100.0% (17 of 17 strings) Translation: hr-expense-16.0/hr-expense-16.0-hr_expense_invoice Translate-URL: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_invoice/it/
Actions performed: - Deprecated `hr.expense.reference` field as part of [1]. - Merged the `hr.expense.is_editable` and `hr.expense.sheet_is_editable` fields as part of [1]. - Renamed `hr.expense.unit_amount` to `hr.expense.price_unit`. - Renamed `hr.expense.attachment_number` to `hr.expense.nb_attachment`. - Renamed `hr.expense.approve_expense_sheets()` to `hr.expense.action_approve_expense_sheets()`. - Renamed `hr.expense.account_move_id` to `hr.expense.account_move_ids`. - Renamed `hr.expense.total_amount` to `hr.expense.total_amount_currency`. - Inherit compute of `hr.expense.sheet.state` to consider expenses with linked invoices. - Switched from old %-based string formatting to f-strings. - Replaced the use of `attrs` in views with their equivalent Python expressions as part of [2]. - Adapted the `hr.expense.sheet` records creation in tests. - Updated to use the employee partner from `hr.employee.work_contact_id` instead of `hr.employee.address_home_id` since it has been split into multiple fields. - Added the `hr.expense.amount_residual` field to maintain the one invoice per expense functionality. - Adapted test assertions for `hr.expense.sheet.state` since it is now a computed field. Co-authored-by: desdelinux <luigys@vauxoo.com> [1]: odoo/odoo#130244 [2]: odoo/odoo#104741
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
…ot all being postable when invoices are in draft
Odoo is handling the amount always tax included, so we need to transfer to the invoice the proper base amount, not the price unit.
… without invoices)
dd2ee47 to
e3e4d05
Compare
e3e4d05 to
e5c801b
Compare
e5c801b to
218164f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of `hr_expense_invoice` from 18.0 to 19.0 (migration guide).
Non-mechanical adaptations worth flagging
19.0 relevance
Two flows the module preserves that 19.0 core does not absorb:
UX with sheets removed: the expense form's `invoice_id` m2o is the entry point. Smart-button on `account.move` shows linked expense. Batch "create bill from N expenses" UX from the 18.0 sheet button is dropped — the 19.0 equivalent is selecting multiple expenses in the list and using core's per-expense `action_expense_create_invoice` (or a list-view action — out of scope for this slim MIG). Happy to add it if reviewers ask.
CI may surface tweaks needed on view xpaths (19.0's `hr.expense` form structure shifted around `product_id`/`quantity`); will iterate.