Skip to content

[MIG] product_ux: Migration to 20.0 - #963

Closed
jcadhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76355-jc
Closed

jcadhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76355-jc

Conversation

@jcadhoc

@jcadhoc jcadhoc commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Migration of product_ux from 19.0 to 20.0.

Task: https://www.adhoc.inc/odoo/project.task/76355

What changed for 20.0

  • Label batching: 20.0 unified the label reports (product.report_product_label_dymo and product.report_product_label_pdf) and the data now travels as labels[].copies, so the 19.0 override no longer triggered. Rewritten for the new shape and extended to sheet formats (2x7/4x7/4x12, also used by lot/package/location labels), cutting batches at whole pages. product_ux.dymo_label_batch_size keeps its key and meaning (labels per wkhtmltopdf call). get_param → get_int. Falls back to a single render when the report comes back as HTML (test mode).
  • Pricelist rules: compute_price lost percentage/formula (now discount/markup/fixed). The default rounding now applies only to surcharge (markup) rules and only when unset: a rounded discount is no longer is_plain_discount, and sales would stop showing the discount.
  • Views: dropped the inheritance of the removed product.product_variant_easy_edit_view; uom list/form inherit uom.uom_uom_view_list/uom_uom_view_form; the image keeps the new 20.0 options and only drops convert_to_webp; the rules stat button goes inside the native button_box with a Material icon.
  • Demo rule: formula → discount.
  • Removed migrations/18.0.1.4.0 (cannot run when upgrading from 19.0; filtered on compute_price = 'formula').

Simplification and improvements

  • Dropped applied_description (same as the native rule name).
  • The uom and pricelist rule search views were standalone primary views: the uom one replaced the native search view (losing the Archived filter) and the rule one was never used. Both now extend the native views (same xmlids; 20.0 turns them into extensions on update).
  • Rule count on the pricelist stat button (item_count).
  • Added tests (the module had none).

Test plan

  • Fresh 20.0 database with demo: installs; --test-tags /product_ux: 14 tests OK.
  • Labels rendered with the real engine: Dymo, 2x7 and 4x12 batched renders give the same page count as a single render.
  • Simulated 19.0 primary search views: after -u they become extensions.
  • No data migration script needed. Not tested against a real upgraded database: the 19→20 upgrade pipeline is not available yet.

@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

- Bump version to 20.0.1.0.0 and set installable
- Label batching: follow the unified 20.0 label reports (Dymo and sheets),
  labels[].copies data, batches counted in labels and cut at whole pages;
  get_param -> get_int; single render when it comes back as HTML (tests)
- Pricelist rules: default rounding only on surcharge (markup) rules and
  only when unset, so discount rules stay plain discounts
- Pricelist: add item_count, shown in the rules stat button inside the
  native button_box (Material icon)
- Drop applied_description (same as the native rule name)
- Views: drop inheritance of removed product_variant_easy_edit_view; uom
  views inherit uom_uom_view_list/form; uom and pricelist rule search views
  extend the native ones; image keeps the 20.0 options, only without
  convert_to_webp
- Demo: compute_price formula -> discount
- Remove migrations/18.0.1.4.0 (cannot run when upgrading from 19.0)
- Add tests; update README and translations

Change note: Las listas de precios muestran en su botón cuántas reglas tienen, y las reglas se pueden buscar y agrupar por producto, categoría y tipo de aplicación. Las unidades de medida se buscan también por su descripción. Imprimir miles de etiquetas, también en hoja, ya no corta la generación del PDF. Las reglas de recargo nuevas se redondean solas a la precisión de precio, y las de descuento siguen mostrando el descuento en la venta.
@jcadhoc
jcadhoc force-pushed the 20.0-t-76355-jc branch 2 times, most recently from be52c51 to 496c2ef Compare October 22, 2026 15:03
mav-adhoc and others added 2 commits October 22, 2026 14:37
…omplete

- Let a consultant pick up to 3 extra product fields in Settings, with the
  native field_selector widget over an auxiliary field holding the model.
  A compute with inverse joins the three boxes into a system parameter, in
  the same format as the one of the eCommerce
- Extend the autocomplete from name_search with super(), and only when the
  native search did not fill the limit. Every word, in any order and on any
  of the fields (name and default_code always included), in a single query
- Validate on save, on every step of the path, what the widget cannot: the
  field exists, Odoo can search it (stored or with a search method) and this
  user can read it, the same criterion as the search. The last step has to
  be a text field or a relation, never HTML nor an attachment
- Do not offer properties on the selector: the validation cannot confirm a
  property exists, so a path with a typo would be saved and find nothing
- Skip at search time the paths this user cannot reach, instead of raising.
  The validation on save is about the definition of the field, while the
  access rights are of whoever searches, and a saved path can also stop
  resolving when a module is uninstalled
- Leave the cap of three to the boxes and to the search itself, so a hand
  edited parameter with more paths never blocks saving the settings of
  another app
- Without configuration the search behaves exactly like Odoo, and the switch
  is read with str2bool, so a parameter holding the text "False" is off

Change note: En Ajustes se pueden elegir hasta 3 campos del producto por los
que además se busca. Con eso, el autocompletado del producto en una línea de
venta o de compra encuentra también por esos campos. Se aceptan varias palabras
en cualquier orden, repartidas entre esos campos, el nombre y la referencia
interna. Sin configurar nada, la búsqueda se comporta igual que antes. Al
guardar se rechaza un campo que Odoo no puede buscar, con un mensaje que
explica el motivo. Si un usuario no tiene permiso para leer el modelo al que
llega un campo configurado, para ese usuario se busca sin ese campo, en vez de
cortarle el autocompletado.

closes ingadhoc#951

Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
(cherry picked from commit 6a6101d)
Updated by "Update PO files to match POT (msgmerge)" add-on in Weblate.

Translation: product-19.0/product-19.0-product_ux
Translate-URL: https://translation.dev-adhoc.com/projects/product-19-0/product-19-0-product_ux/
(cherry picked from commit f327321)
@mav-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump

@roboadhoc

Copy link
Copy Markdown
Contributor

@jcadhoc @mav-adhoc because this PR has multiple commits, I need to know how to merge it:

  • merge to merge directly, using the PR as merge commit message
  • rebase-merge to rebase and merge, using the PR as merge commit message
  • rebase-ff to rebase and fast-forward

@mav-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Oct 22, 2026
- Bump version to 20.0.1.0.0 and set installable
- Label batching: follow the unified 20.0 label reports (Dymo and sheets),
  labels[].copies data, batches counted in labels and cut at whole pages;
  get_param -> get_int; single render when it comes back as HTML (tests)
- Pricelist rules: default rounding only on surcharge (markup) rules and
  only when unset, so discount rules stay plain discounts
- Pricelist: add item_count, shown in the rules stat button inside the
  native button_box (Material icon)
- Drop applied_description (same as the native rule name)
- Views: drop inheritance of removed product_variant_easy_edit_view; uom
  views inherit uom_uom_view_list/form; uom and pricelist rule search views
  extend the native ones; image keeps the 20.0 options, only without
  convert_to_webp
- Demo: compute_price formula -> discount
- Remove migrations/18.0.1.4.0 (cannot run when upgrading from 19.0)
- Add tests; update README and translations

Change note: Las listas de precios muestran en su botón cuántas reglas tienen, y las reglas se pueden buscar y agrupar por producto, categoría y tipo de aplicación. Las unidades de medida se buscan también por su descripción. Imprimir miles de etiquetas, también en hoja, ya no corta la generación del PDF. Las reglas de recargo nuevas se redondean solas a la precisión de precio, y las de descuento siguen mostrando el descuento en la venta.

Part-of: #963
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
roboadhoc pushed a commit that referenced this pull request Oct 22, 2026
…omplete

- Let a consultant pick up to 3 extra product fields in Settings, with the
  native field_selector widget over an auxiliary field holding the model.
  A compute with inverse joins the three boxes into a system parameter, in
  the same format as the one of the eCommerce
- Extend the autocomplete from name_search with super(), and only when the
  native search did not fill the limit. Every word, in any order and on any
  of the fields (name and default_code always included), in a single query
- Validate on save, on every step of the path, what the widget cannot: the
  field exists, Odoo can search it (stored or with a search method) and this
  user can read it, the same criterion as the search. The last step has to
  be a text field or a relation, never HTML nor an attachment
- Do not offer properties on the selector: the validation cannot confirm a
  property exists, so a path with a typo would be saved and find nothing
- Skip at search time the paths this user cannot reach, instead of raising.
  The validation on save is about the definition of the field, while the
  access rights are of whoever searches, and a saved path can also stop
  resolving when a module is uninstalled
- Leave the cap of three to the boxes and to the search itself, so a hand
  edited parameter with more paths never blocks saving the settings of
  another app
- Without configuration the search behaves exactly like Odoo, and the switch
  is read with str2bool, so a parameter holding the text "False" is off

Change note: En Ajustes se pueden elegir hasta 3 campos del producto por los
que además se busca. Con eso, el autocompletado del producto en una línea de
venta o de compra encuentra también por esos campos. Se aceptan varias palabras
en cualquier orden, repartidas entre esos campos, el nombre y la referencia
interna. Sin configurar nada, la búsqueda se comporta igual que antes. Al
guardar se rechaza un campo que Odoo no puede buscar, con un mensaje que
explica el motivo. Si un usuario no tiene permiso para leer el modelo al que
llega un campo configurado, para ese usuario se busca sin ese campo, en vez de
cortarle el autocompletado.

closes #951

Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
(cherry picked from commit 6a6101d)

Part-of: #963
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
@roboadhoc roboadhoc added the 19.1 label Oct 22, 2026
@roboadhoc roboadhoc closed this in 086305a Oct 22, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76355-jc branch October 22, 2026 18:51

This branch was previously deployed

1 inactive deployment
merge — e9400bfd Deployed Oct 22, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants