Skip to content

[19.0] [IMP] sale_stock_available_info_popup: compute the quantities by batch - #100

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-sale_stock_available_info_popup-batch
Oct 29, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-sale_stock_available_info_popup-batch

Conversation

@ivantodorovich

@ivantodorovich ivantodorovich commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The available to promise of each sale order line was read with its own context, so it was computed once per line.

It is now computed like the quantities of the sale_stock module (_compute_qty_at_date): the lines are grouped by warehouse and scheduled date, and the quantities are read once per group. A quotation with a single warehouse and delivery date then computes them once.

@OCA-git-bot OCA-git-bot added mod:sale_stock_available_info_popup Module sale_stock_available_info_popup series:19.0 labels Oct 28, 2026
@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-sale_stock_available_info_popup-batch branch from e05581b to 9697373 Compare October 28, 2026 18:19
@ivantodorovich
ivantodorovich marked this pull request as ready for review October 28, 2026 18:20
@pedrobaeza pedrobaeza added this to the 19.0 milestone Oct 29, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We left explicitly the computation to be done on all the sales orders, as our customer wants to check availability on confirmed ones.

Like the quantities of the sale_stock module: read once per warehouse and
scheduled date instead of once per line.
@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-sale_stock_available_info_popup-batch branch from 9697373 to c01b48b Compare October 29, 2026 12:04
@ivantodorovich

Copy link
Copy Markdown
Contributor Author

We left explicitly the computation to be done on all the sales orders, as our customer wants to check availability on confirmed ones.

Alright. It seemed weird to me cause the standard hides the availability fields on confirmed orders, replacing them for "Reserved".

Anyway, I reverted this, keeping only the grouped compute improvement

@pedrobaeza

Copy link
Copy Markdown
Member

Well, the spec was from 15.0/16.0, so maybe things have changed. Are you saying that in this version, the icon is not seen if confirmed? Anyway, AFAIK, if not seen, it's not compute anyway, right?

@ivantodorovich

Copy link
Copy Markdown
Contributor Author

Well, the spec was from 15.0/16.0, so maybe things have changed. Are you saying that in this version, the icon is not seen if confirmed? Anyway, AFAIK, if not seen, it's not compute anyway, right?

The icon is seen, but the content changes from showing availability information to reservations.
Here's how it looks in standard in 19.0

Quotation:
image

Confirmed order:
image

@pedrobaeza

Copy link
Copy Markdown
Member

I see. Well, what you consider that fits best for the purpose of the module? Does it make sense to show the available to order in confirmed orders or not?

@ivantodorovich

Copy link
Copy Markdown
Contributor Author

I see. Well, what you consider that fits best for the purpose of the module? Does it make sense to show the available to order in confirmed orders or not?

IMO it doesn't, that's why I added the state filter before -- this information is only useful before committing to the customer, that is.. before the order confirmation.

Anyway, I reverted that already and I prefer not to touch it again, so this PR really sticks to the batch computation perf improvement now

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 19.0-ocabot-merge-pr-100-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 86c8269 into OCA:19.0 Oct 29, 2026
8 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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.

4 participants