Repository navigation
[IMP] product_catalog_tree: add tests - #972
Closed
matiasperalta1 wants to merge 1 commit into
Closed
matiasperalta1 wants to merge 1 commit into
matiasperalta1 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
La prueba de edición no verifica que la cantidad sea el único campo editable.
1 open finding
What changed in this PR
Añade cobertura para el catálogo en ventas y facturas antes de la migración a Odoo 20.
Cambios:
- Pruebas de acciones, cantidades, precios y unidades de medida.
- Cobertura de contextos sin pedido y configuración de la vista lista.
| File | Description |
|---|---|
product_catalog_tree/tests/test_product_catalog_tree.py |
Amplía las pruebas del catálogo para ventas y facturas. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+209
to
+215
| def test_the_list_is_editable_in_quantity_only_and_cannot_create(self): | ||
| view = self.env.ref("product_catalog_tree.product_view_tree_catalog") | ||
| arch = self.env["product.product"].get_view(view_id=view.id, view_type="list")["arch"] | ||
| self.assertIn('editable="top"', arch) | ||
| self.assertIn('create="false"', arch) | ||
| self.assertIn("product_list_catalog", arch) | ||
| self.assertIn('name="product_catalog_qty"', arch) |
…voices - Add TestProductCatalogTreeOrders in tests/test_product_catalog_tree.py (TransactionCase, no demo data) - Cover the catalog action: the list comes first and the other views stay, and the warehouse location filter - Cover the list view: editable on top, no create, js_class and the quantity field - Cover sale orders: "+" adds one each time and the row shows quantity and price, writing the quantity sets it and zero removes the line, several lines of the product are adjusted by the difference, and a line in another unit of measure keeps its unit - Cover customer invoices: the list opens first, "+" and writing the quantity - Cover the empty row and the inert buttons when the context has no order - Patch the HTTP request used by the 19.0 order models, absent in a test; not needed in 20.0 Change note: Sin cambios para quien usa el módulo. Se agregan pruebas automáticas que verifican que el catálogo en lista abra primero, sume y edite cantidades en cotizaciones y facturas, conserve la unidad de medida de una línea y filtre por el almacén de la orden.
matiasperalta1
force-pushed
the
19.0-t-76418-mnp
branch
from
October 14, 2026 15:14
658d9ab to
ece23a4
Compare
Contributor
|
@roboadhoc r+ nobump |
roboadhoc
pushed a commit
that referenced
this pull request
Oct 22, 2026
…voices - Add TestProductCatalogTreeOrders in tests/test_product_catalog_tree.py (TransactionCase, no demo data) - Cover the catalog action: the list comes first and the other views stay, and the warehouse location filter - Cover the list view: editable on top, no create, js_class and the quantity field - Cover sale orders: "+" adds one each time and the row shows quantity and price, writing the quantity sets it and zero removes the line, several lines of the product are adjusted by the difference, and a line in another unit of measure keeps its unit - Cover customer invoices: the list opens first, "+" and writing the quantity - Cover the empty row and the inert buttons when the context has no order - Patch the HTTP request used by the 19.0 order models, absent in a test; not needed in 20.0 Change note: Sin cambios para quien usa el módulo. Se agregan pruebas automáticas que verifican que el catálogo en lista abra primero, sume y edite cantidades en cotizaciones y facturas, conserve la unidad de medida de una línea y filtre por el almacén de la orden. closes #972 Signed-off-by: Guido Galetto <gal@adhoc.inc>
This branch was previously deployed
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.


Adds tests for sale orders and customer invoices to
product_catalog_tree. The module already had 3 tests, all for purchase orders with products in units. They pin the 19.0 behaviour before the migration to 20.0 (separate PR: #971).Task: https://www.adhoc.inc/odoo/project.task/76418
What is covered
sale_stock).js_classand the quantity field.+adds one each time and the row shows the quantity and the price; writing the quantity sets it and zero removes the line; with several lines of the product the difference is written; a line in another unit of measure keeps its unit when+is used (2 dozens become 3 dozens, not 3 units).+and writing the quantity.Test plan
odoo -i product_catalog_tree,sale_stock,purchase --test-tags /product_catalog_treeon 19.0: 13 tests, 0 failed.productandsalethat installs without Enterprise (54 modules;account_uxleft out because its view does not load with the core of the test container): 12 tests at that moment, 0 failed. This is the stackci/runbot-obaruns.+adding two, list not editable, list view not first, warehouse filter removed, several lines not adjusted, invoice lines read fromorder_line, and the order check removed from the computation. The last one needed the test with the model but no order.child_fieldin the context of the 3 original tests), and fail there when the unit of measure is forced to the product one or whenchild_fieldis not passed.