[FIX] stock_ux, stock_batch_picking_ux: drop removed partner mobile field - #982
Open
jue-adhoc wants to merge 1 commit into
Open
[FIX] stock_ux, stock_batch_picking_ux: drop removed partner mobile field#982jue-adhoc wants to merge 1 commit into
jue-adhoc wants to merge 1 commit into
Conversation
…ield res.partner.mobile no longer exists in 19.0, it was merged into phone. The shipping label ZPL templates still referenced it, so printing the label raised "'res.partner' object has no attribute 'mobile'" whenever the partner had no phone set (the mobile branch is only evaluated when the phone one is falsy, which is why it went unnoticed). Fall back to the parent partner phone instead, as the PDF variant of stock_ux already does since 9007ba2.
Collaborator
There was a problem hiding this comment.
Pull request overview
Este PR corrige el crash al imprimir etiquetas (ZPL/PDF) en Odoo 19.0 eliminando referencias a res.partner.mobile (campo eliminado/mergeado a phone) en templates de reporte de stock_ux y stock_batch_picking_ux.
Changes:
stock_ux: elimina ramast-elifque referenciabanpartner_id.mobile(y parent mobile) en el template ZPL.stock_batch_picking_ux: elimina referencias amobiley simplifica la lógica a una cadenat-if / t-elif / t-elsepara el fallback de teléfono (partner → parent) tanto en ZPL como en el bloque HTML/PDF.- Pendiente: según el propio PR, falta el bump de versión en
__manifest__.pyde ambos módulos para asegurar que el update aplique los cambios enir.ui.view.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| stock_ux/report/picking_templates.xml | Quita el uso de partner_id.mobile en el ZPL y mantiene el fallback por phone. |
| stock_batch_picking_ux/reports/picking_templates.xml | Elimina mobile y simplifica el fallback a phone en ZPL y PDF/HTML. |
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.

Problem
Printing the shipping label ZPL crashes on 19.0:
res.partner.mobileno longer exists in 19.0 — it was merged intophone. Both ZPL templates still referenced it:stock_ux.custom_label_transfer_template_view_zplstock_batch_picking_ux.custom_label_batch_transfer_template_view_zpl(and its PDF variant, which had the same reference)It went unnoticed because the
mobilebranch is at-elif/t-elseover thephoneone: it is only evaluated when the partner has no phone set. With a phone loaded the label renders fine, which is why this survived the migration.stock_ux's PDF variant was already fixed in 9007ba2 (#908); the ZPL of the same module was missed, andstock_batch_picking_uxwas not covered at all.Approach
Drop the
mobilebranches and keep the intended fallback chain: partner phone → parent partner phone. Same shape 9007ba2 applied to the PDF.In
stock_batch_picking_uxthe two blocks were at-ifplus a secondt-ifwhose condition manually re-checked that the first one had not matched (... and batch.partner_id.phone == False and ...). Now thatmobileis gone those collapse into a plaint-if/t-elif/t-elsechain, which is what the manual guard was emulating — same rendering, less to read.No behaviour change for partners that have a phone.
Test plan
On a 19.0 build, for both
stock_ux(picking) andstock_batch_picking_ux(batch):Tel:, no traceback. This is what fails today.Merge needs
bump— the diff touches data XML that is persisted inir.ui.view, so the modules must be updated on deploy.