[FIX] stock_voucher_ux: print voucher on validation when auto-print is set - #975
Open
mav-adhoc wants to merge 1 commit into
Open
[FIX] stock_voucher_ux: print voucher on validation when auto-print is set#975mav-adhoc wants to merge 1 commit into
mav-adhoc wants to merge 1 commit into
Conversation
Collaborator
mav-adhoc
force-pushed
the
18.0-t-70863-mav
branch
3 times, most recently
from
July 20, 2026 17:55
32f2388 to
ce1e5f0
Compare
mav-adhoc
force-pushed
the
18.0-t-70863-mav
branch
5 times, most recently
from
July 22, 2026 16:39
d10bf3e to
21ff7be
Compare
…s set Print the delivery voucher automatically on validation only when the operation type has `auto_print_delivery_slip` enabled (the native v18 flag), reusing the existing methods without re-numbering: - autoprinted books: already numbered in _action_done, only print; - pre-printed books: numbered on print by real page count (assign=True), same path as the "Print Voucher" button. Operation types without the flag are only validated (no auto-print), so this does not change the behavior of types that don't opt in. The backorder confirmation wizard is routed through core process(), which re-runs button_validate() on the pickings in v18, so it reuses the same print/number path above. This skips stock_voucher's wizard override, which reprinted with do_print_voucher() without assign (leaving pre-printed books unnumbered) and returned a tuple the web client never executes.
mav-adhoc
force-pushed
the
18.0-t-70863-mav
branch
from
July 22, 2026 17:21
21ff7be to
b541a9d
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.

What
Print the delivery voucher automatically on validation, gated by the operation type's native
auto_print_delivery_slipflag — so it only happens when explicitly enabled, not on every validation.Why
In Odoo 18
button_validatereturnsTrue(notNone) when validating without a wizard, so theif res is Nonebranch instock_voucher.button_validatestopped running after the migration: the voucher number is still assigned but the voucher is no longer printed on validation. Restoring it unconditionally would print on every book picking; instead we tie it toauto_print_delivery_slipso each operation type opts in.How
Override
button_validateinstock_voucher_ux. On a completed validation (state == "done") of a single picking whose operation type hasauto_print_delivery_slipand a book:_action_done, only print (do_print_voucher);do_print_and_assign,assign=True), same path as the "Print Voucher" button.Without the flag, or on a wizard (backorder), the
super()result is returned untouched — no auto-print, no other behavior changes.Test plan
Operation type with
auto_print_delivery_slipon:Operation type with the flag off: validating only completes the transfer, no print.
Task: https://www.adhoc.inc/odoo/project.task/70863