Skip to content

[16.0][ADD] sale_invoice_partial_lines#897

Merged
eantones merged 1 commit into16.0from
16.0-add-sale_invoice_partial_lines
Apr 27, 2026
Merged

[16.0][ADD] sale_invoice_partial_lines#897
eantones merged 1 commit into16.0from
16.0-add-sale_invoice_partial_lines

Conversation

@eantones
Copy link
Copy Markdown
Member

Summary

New module sale_invoice_partial_lines that lets the user pick which sale order lines go into the next regular invoice via a per-line Invoice next checkbox persisted in the database.

  • Field: to_invoice_next boolean on sale.order.line (DB-persisted, copy=False). The selection survives pagination, refreshes and browser restarts — important on quotations with hundreds of lines.
  • UX: optional column on the embedded order-line tree (visible from confirmed state onwards), footer counter on the sale order form summarising the marked subset (X lines · subtotal Y €), and a search filter on the standalone order-line list view.
  • Wizard: standard sale.advance.payment.inv extended with an only_selected_lines checkbox, visible only when Regular invoice is selected. When checked, _get_invoiceable_lines keeps only marked product lines plus their wrapping sections, notes and prior down payments; raises UserError if no line is marked. The flag is reset on every invoiced line right after the invoice is created.
  • Tests: 6 cases covering happy path, no-marked-lines validation, post-invoice reset, section pruning, default path parity, and counter computed fields.
  • Translations: ca.po and es.po for the new strings only.

Test plan

  • Module installs cleanly (-i sale_invoice_partial_lines)
  • Tests pass (--test-tags=/sale_invoice_partial_lines, 6/6)
  • pre-commit run -a clean
  • Visual smoke test on test environment (Carles)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 25.88235% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.79%. Comparing base (20d034b) to head (f11e02c).
⚠️ Report is 1 commits behind head on 16.0.

Files with missing lines Patch % Lines
...ial_lines/tests/test_sale_invoice_partial_lines.py 19.04% 85 Missing ⚠️
sale_invoice_partial_lines/models/sale_order.py 21.62% 29 Missing ⚠️
..._partial_lines/wizards/sale_advance_payment_inv.py 33.33% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             16.0     #897      +/-   ##
==========================================
- Coverage   44.28%   43.79%   -0.49%     
==========================================
  Files         317      325       +8     
  Lines        6294     6464     +170     
  Branches     1000     1011      +11     
==========================================
+ Hits         2787     2831      +44     
- Misses       3486     3612     +126     
  Partials       21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eantones eantones force-pushed the 16.0-add-sale_invoice_partial_lines branch from 1e0c8e2 to 49384d8 Compare April 27, 2026 13:03
Mark sale order lines and invoice only the marked ones.

Adds a generic boolean ``selected`` on ``sale.order.line`` and an
"Only selected lines" checkbox on the standard ``sale.advance.payment.inv``
wizard. When the wizard runs with that flag, ``_get_invoiceable_lines``
narrows core's regular invoiceable result to the selected lines (sections
and down-payments handled like core), and ``selected`` is reset on the
just-invoiced lines.

Useful for long quotations where the customer wants to invoice subsets
instead of the full order.
@eantones eantones force-pushed the 16.0-add-sale_invoice_partial_lines branch from 49384d8 to f11e02c Compare April 27, 2026 13:13
@eantones eantones merged commit 5352fd7 into 16.0 Apr 27, 2026
11 of 13 checks passed
@eantones eantones deleted the 16.0-add-sale_invoice_partial_lines branch April 27, 2026 13:21
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.

1 participant