[IMP] sale_timesheet_invoice_link: link pending timesheets from invoice form - #946
[IMP] sale_timesheet_invoice_link: link pending timesheets from invoice form#946EmilioPascual wants to merge 1 commit into
Conversation
1bb08d0 to
e748db1
Compare
fcvalgar
left a comment
There was a problem hiding this comment.
Thanks for the work on this improvement @EmilioPascual.
I reviewed the module and found one scenario that I would like to clarify before approval: when an invoice is posted and then reset to draft, the warning to link pending timesheets is no longer displayed again, so it is not possible to link additional timesheets from the invoice form in that scenario.
The following tests were performed:
Test 1: OK - A fixed-price service invoice correctly shows the warning alert when there are timesheets linked to the related sale order line but not yet linked to the invoice.
Test 2: OK - The Link All action correctly links all pending timesheets to the invoice and the warning alert disappears.
Test 3: OK - The Select Manually action opens the filtered list of pending timesheets and allows linking only the selected timesheet entries.
Test 4: OK - The Dismiss action hides the warning alert without linking the pending timesheets to the invoice.
Test 5: OK - Once all pending timesheets are linked to the invoice, the warning alert is no longer displayed.
Test 6: OK - The standard timesheet-based invoicing flow is not affected, and no pending-timesheet warning is shown when Odoo links the timesheets automatically.
Test 7: Not OK / scope clarification - If a posted invoice is reset to draft, the pending-timesheet warning is not displayed again, preventing additional timesheets from being linked from the invoice form.
Test 8: OK - Multiple pending timesheets are correctly counted in the warning alert and can be linked together with Link All.
Could you please confirm whether the reset-to-draft / new pending timesheets scenario is intended to be covered by this module? If it is in scope, I think the dismissed state could be reset when an invoice is reset to draft, or when new pending timesheets are detected after the alert was previously dismissed/linked. If it is not in scope, could you please add this limitation to the README so that users know that additional timesheets created after the alert was dismissed or after the invoice was reset to draft may need to be linked manually outside the invoice alert flow?
…ce form After invoicing a sale order with fixed price, milestone, or manual billing policies, timesheets are never linked to the invoice automatically. This adds a warning alert on the invoice form that detects unlinked timesheets and offers "Link All", "Select Manually", or "Dismiss" actions. - Add computed fields timesheet_pending_ids, timesheet_pending_count, timesheet_alert_dismissed to account.move - Add warning alert on invoice form with Link All / Select Manually / Dismiss buttons - Add "Link to Invoice" header button on timesheet list view - Reuse _timesheet_domain_get_invoiced_lines for domain logic Assisted-by: OpenCode + DeepSeek V4 Flash MT-14588 @moduon
e748db1 to
1e17f6d
Compare
@fcvalgar I add new flow when invoice is reset to draft and there are timesheets pending yet. Could you review againt? Thank you |
fcvalgar
left a comment
There was a problem hiding this comment.
Great work on this improvement @EmilioPascual and on addressing the reported scenario.
The following tests were performed:
Test 1: OK - A fixed-price service invoice correctly shows the warning alert when there are timesheets linked to the related sale order line but not yet linked to the invoice.
Test 2: OK - The Link All action correctly links all pending timesheets to the invoice and the warning alert disappears.
Test 3: OK - The Select Manually action opens the filtered list of pending timesheets and allows linking only the selected timesheet entries.
Test 4: OK - The Dismiss action hides the warning alert without linking the pending timesheets to the invoice.
Test 5: OK - Once all pending timesheets are linked to the invoice, the warning alert is no longer displayed.
Test 6: OK - The standard timesheet-based invoicing flow is not affected, and no pending-timesheet warning is shown when Odoo links the timesheets automatically.
Test 7: OK - When a posted invoice is reset to draft and pending timesheets still exist, the warning alert is displayed again and allows linking the remaining timesheets.
Test 8: OK - Multiple pending timesheets are correctly counted in the warning alert and can be linked together with Link All.
LGTM
After invoicing a sale order with fixed price, milestone, or manual billing policies, timesheets are never linked to the invoice automatically. This adds a warning alert on the invoice form that detects unlinked timesheets and offers "Link All", "Select Manually", or "Dismiss" actions.
@chienandalu @rafaelbn @Gelojr please review it. Thank you.
MT-14588 @moduon