Skip to content

[18.0][MIG] sale_order_product_availability_inline: Migration to version 18.0#3576

Merged
OCA-git-bot merged 13 commits intoOCA:18.0from
Tecnativa:18.0-mig-sale_order_product_availability_inline
Feb 13, 2025
Merged

[18.0][MIG] sale_order_product_availability_inline: Migration to version 18.0#3576
OCA-git-bot merged 13 commits intoOCA:18.0from
Tecnativa:18.0-mig-sale_order_product_availability_inline

Conversation

@carlos-lopez-tecnativa
Copy link
Copy Markdown
Contributor

TT54284
@Tecnativa @pedrobaeza @sergio-teruel @SodexisTeam Could you please review this?

Ernesto Tejeda and others added 13 commits February 7, 2025 07:54
Show product availability in sales order lines product drop-down.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_order_product_availability_inline
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_product_availability_inline/
Currently translated at 100.0% (2 of 2 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_order_product_availability_inline
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_product_availability_inline/es/
Copy link
Copy Markdown
Contributor

@sergio-teruel sergio-teruel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @carlos-lopez-tecnativa

the available cuantities is not shown!!

image

image

@carlos-lopez-tecnativa
Copy link
Copy Markdown
Contributor Author

Sorry @carlos-lopez-tecnativa

the available cuantities is not shown!!

@sergio-teruel Please take into account that in sale.order.line, we have two fields: product_id and product_template_id. This module only affects product_id. If you add this field to the list view, the quantity is displayed.

I think we need to add support for the other field. What do you think?
image

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration sale_order_product_availability_inline

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 7, 2025
@sergio-teruel
Copy link
Copy Markdown
Contributor

H.. @carlos-lopez-tecnativa you are right...

@youring
Copy link
Copy Markdown

youring commented Feb 8, 2025

Tested in runboat.
Open existing demo sale order, product variant not selected in order line, the free_qty will show up beside product_template_id.
image

If create a new quotation, select product variant, select some products, free_qty is still displayed after saving the sale order.
image
Isn't it meant to be displayed only in the dropdown list? In Odoo 16, it will disappear after saving.

@carlos-lopez-tecnativa
Copy link
Copy Markdown
Contributor Author

Tested in runboat. Open existing demo sale order, product variant not selected in order line, the free_qty will show up beside product_template_id. image

@youring sorry, but I don't understand.

I noticed in your image that the product is a variant, not a product template, because the name includes attributes like "Custom, White." Please check again.

In an existing sale order, with the product variant hidden and the product template displayed, the quantity is not shown.

V16
image

V17
image

If create a new quotation, select product variant, select some products, free_qty is still displayed after saving the sale order. image Isn't it meant to be displayed only in the dropdown list? In Odoo 16, it will disappear after saving.

Regarding your second point:

In Odoo 16, the quantity disappears after saving, which matches your observation.
However, in Odoo 17, the quantity remains displayed after saving.

Since this PR is migrating the module to V18 (using V17 as the base branch), the behavior follows the V17 standard.
If this change in behavior is due to an Odoo update, that would be a separate issue outside the scope of this migration.

@youring
Copy link
Copy Markdown

youring commented Feb 12, 2025

Sorry I didn't test Odoo 17. It seems we should fix in v17 first to keep the functionality from v16.

@pedrobaeza
Copy link
Copy Markdown
Member

I don't think the correct behavior is the 16 one. I prefer this "new" one.

@youring
Copy link
Copy Markdown

youring commented Feb 12, 2025

Maybe we could change the name to sale_order_product_available_search or sale_order_product_available_dropdown, and make a "new" one sale_order_line_available_inline.
Anyway, I think the product column is too crowded to carry available quantity inline.

According to the original purpose of the module since v13, I think we should go this way as stock_picking_product_availability_inline OCA/stock-logistics-workflow#1847

@pedrobaeza
Copy link
Copy Markdown
Member

@sergio-teruel what's your take on this?

@sergio-teruel
Copy link
Copy Markdown
Contributor

sergio-teruel commented Feb 13, 2025

Ok.. I think that this module is correct...
The main difference is that in v18 by default the product_tmpl_id is shown
image
but this module does not cover that case, at least not without more budget.

If user change to product variant the module runs as expected...

So I approve this migration

And the units remain the same as in the previous version.
image

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-3576-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 270df13 into OCA:18.0 Feb 13, 2025
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 5c54cf1. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 18.0-mig-sale_order_product_availability_inline branch February 13, 2025 20:02
trisdoan pushed a commit to trisdoan/sale-workflow that referenced this pull request Mar 13, 2025
Signed-off-by pedrobaeza
@dreispt
Copy link
Copy Markdown
Member

dreispt commented Jun 17, 2025

@carlos-lopez-tecnativa can you help understanding the test error on PR #3581 please?

@carlos-lopez-tecnativa
Copy link
Copy Markdown
Contributor Author

@carlos-lopez-tecnativa can you help understanding the test error on PR #3581 please?

@dreispt I confirm that this commit odoo/odoo#209141 changed the behavior and caused the test to fail.
I tested before this commit and the test worked fine.
Later, I tested again after updating the Odoo code with this commit, and the test failed.

Before this commit, the name was displayed as:
image
After this commit, the name is displayed as:
image

So, I'm not sure what the best approach is — whether to update the test (change assertFalse to assertTrue) or report this behavior to Odoo. WDYT?

@pedrobaeza
Copy link
Copy Markdown
Member

Section and notes should be excluded from putting such text.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.