Skip to content

[17.0][FIX] product_secondary_unit: ensure qty persists.#10

Closed
Qlasta wants to merge 1 commit into17.0-versadafrom
17.0-fix-product-secondary-unit-recompute-qty-exists
Closed

[17.0][FIX] product_secondary_unit: ensure qty persists.#10
Qlasta wants to merge 1 commit into17.0-versadafrom
17.0-fix-product-secondary-unit-recompute-qty-exists

Conversation

@Qlasta
Copy link

@Qlasta Qlasta commented Jun 17, 2025

Problem occurred after sale_stock module update.
task id - 26079

Description
After new write method update in sale.order.line, line change triggers sec uom qty calculation and test fails in sale_order_secondary_unit module.

Current Behaviour
Test fails:

2025-06-11 03:44:49,795 1 INFO odoodb odoo.addons.sale_order_secondary_unit.tests.test_sale_order: ======================================================================
Error: 2025-06-11 03:44:49,795 1 ERROR odoodb odoo.addons.sale_order_secondary_unit.tests.test_sale_order: FAIL: TestSaleOrder.test_independent_type

"/opt/odoo/projects/sale-workflow/sale_order_secondary_unit/tests/test_sale_order.py", line 95, in test_independent_type
   self.assertEqual(self.order.order_line.product_uom_qty, previous_uom_qty)
pr=2890#step:8:3432)AssertionError: 1.0 != 0.0

Expected Behavior
Test does not fail. Setting secondary_uom_id on line (at the moment when secondary qty is not set), won't reset existing product_uom_qty .

Proposed implementation
Check if secondary_uom_qty exists, if not - do not continue calculation and do not reset qty.

@Qlasta Qlasta force-pushed the 17.0-fix-product-secondary-unit-recompute-qty-exists branch from 1dbb3ba to cf94add Compare June 17, 2025 08:45
@Qlasta Qlasta force-pushed the 17.0-fix-product-secondary-unit-recompute-qty-exists branch from cf94add to 7ce6857 Compare June 17, 2025 08:58
@Qlasta Qlasta marked this pull request as ready for review June 17, 2025 08:59
@Qlasta Qlasta requested review from a team June 17, 2025 08:59
@oerp-odoo
Copy link

@Qlasta we should now create pull requests targeting OCA repo. And then use git-aggregator to combine it into final aggregated branch (you can see examples in repos.yml). So we should avoid 17.0-versada branches.

@Qlasta Qlasta closed this Jun 17, 2025
@Qlasta
Copy link
Author

Qlasta commented Jun 17, 2025

PR created on OCA repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants