[FIX] stock_batch_picking_voucher: asignar números de remitos antes de imprimir#929
Open
mav-adhoc wants to merge 1 commit into
Open
[FIX] stock_batch_picking_voucher: asignar números de remitos antes de imprimir#929mav-adhoc wants to merge 1 commit into
mav-adhoc wants to merge 1 commit into
Conversation
Collaborator
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adjusts the batch picking voucher printing flow to assign voucher numbers based on an estimated page count, and bumps the module version accordingly.
Changes:
- Update
do_print_and_assign()to compute apagesvalue and callassign_numbers(pages, book)before printing. - Remove the previous branch that skipped number assignment for non-
autoprintedbooks and used abatchcontext for printing. - Bump addon version from
18.0.1.2.0to18.0.1.3.0.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| stock_batch_picking_voucher/models/stock_picking_batch.py | Changes number assignment + printing control flow to depend on autoprinted and estimated pages. |
| stock_batch_picking_voucher/manifest.py | Version bump reflecting the behavioral change. |
Comment on lines
+77
to
+78
| pages = 1 if self.book_id.autoprinted else (self.estimated_number_of_pages or 1) | ||
| self.assign_numbers(pages, self.book_id) |
| self.assign_numbers(1, self.book_id) | ||
| pages = 1 if self.book_id.autoprinted else (self.estimated_number_of_pages or 1) | ||
| self.assign_numbers(pages, self.book_id) | ||
| return self.do_print_batch_vouchers() |
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.

Summary
do_print_and_assigndel modelostock.picking.batch: antes, cuando el talonario no era autoprinted (numeración por sistema), el número de remito se asignaba después de generar el PDF (via el controlador HTTP), por lo que la primera impresión salía sin número.estimated_number_of_pages(o 1 si no está definido), de modo que la primera impresión ya contiene el número de remito.Tarea relacionada
https://www.adhoc.inc/odoo/my-tasks/67613
Test plan
done.