Repository navigation
[19.0] [IMP] sale_stock_available_info_popup: compute the quantities by batch - #100
Conversation
e05581b to
9697373
Compare
pedrobaeza
left a comment
There was a problem hiding this comment.
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.
9697373 to
c01b48b
Compare
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 |
|
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. |
|
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 |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 4cfdfc4. Thanks a lot for contributing to OCA. ❤️ |


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_stockmodule (_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.