Skip to content

[FIX] safe_eval: 3.11 compatibility#136943

Closed
xmo-odoo wants to merge 1 commit intoodoo:saas-16.2from
odoo-dev:saas-16.2-fix-3.11-compat-xmo
Closed

[FIX] safe_eval: 3.11 compatibility#136943
xmo-odoo wants to merge 1 commit intoodoo:saas-16.2from
odoo-dev:saas-16.2-fix-3.11-compat-xmo

Conversation

@xmo-odoo
Copy link
Copy Markdown
Collaborator

Complement on 1e35315 (#112450): alongside the split between forwards and backwards jump we missed that 3.11 has a specialized version of each for the is None and is not None cases. A use of that was added in standard in 16.5 (#120446) but more generally it makes sense that server actions would support conditional tests against None, probably...

Complement on 1e35315 (odoo#112450):
alongside the split between forwards and backwards jump we missed that
3.11 has a specialized version of each for the `is None` and `is not
None` cases. A use of that was added in standard in 16.5 (odoo#120446) but
more generally it makes sense that server actions would support
conditional tests against `None`, probably...
@xmo-odoo xmo-odoo requested review from d-fence and pimodoo September 28, 2023 11:48
@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 28, 2023

Pull request status dashboard

@C3POdoo C3POdoo requested a review from a team September 28, 2023 11:56
@C3POdoo C3POdoo added the RD research & development, internal work label Sep 28, 2023
@pimodoo
Copy link
Copy Markdown
Collaborator

pimodoo commented Sep 28, 2023

@xmo-odoo looks good to me, but I don't really know if it could be dangerous

@xmo-odoo
Copy link
Copy Markdown
Collaborator Author

looks good to me, but I don't really know if it could be dangerous

I don't think so, as far as I can see it's literally just an optimisation for the is None/is not None conditional.

@xmo-odoo
Copy link
Copy Markdown
Collaborator Author

@robodoo r+

robodoo pushed a commit that referenced this pull request Sep 29, 2023
Complement on 1e35315 (#112450):
alongside the split between forwards and backwards jump we missed that
3.11 has a specialized version of each for the `is None` and `is not
None` cases. A use of that was added in standard in 16.5 (#120446) but
more generally it makes sense that server actions would support
conditional tests against `None`, probably...

closes #136943

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
@robodoo robodoo temporarily deployed to merge September 29, 2023 10:29 Inactive
@robodoo robodoo closed this Sep 29, 2023
@fw-bot fw-bot deleted the saas-16.2-fix-3.11-compat-xmo branch October 13, 2023 10:46
DavidFesquet referenced this pull request Mar 6, 2024
When there is a discrepancy of reserved quantity between `stock.quant.reserved_quantity` and `stock.move.line.product_qty` the UserError 'It is not possible to unreserve more products of %s than you
have in stock' is raised.
This discrepancy can be caused by past bug, customization or direct manipulation of `stock.quant` or `stock.move.line` by the users.
Once this discrepancy is present, it will not disappear by itself.

Currently, there is no functional method to fix these discrepancies, the user encountering this message is stuck until they contact the Odoo support team.

Ideally, we would fix every bug related to the reservation so that this UserError almost never appears.
However, even after multiple bugs fixed (ex: #144176 , #154327 ) and multiple years of feedback, the users keep encountering this error and keep getting stuck when validating/cancelling transfers.

So the idea is to re-introduce a server action like it was done for Odoo 13 & Odoo 14 2 years ago: d99e173 to the current stable version (except the latest one Odoo 17 as we do not have enough perspectives on this version).

The server action checks all the quants and their relative move line to check if match correctly. If not, it will remove the reservation from both.
It could remove the reservation from some unrelated `pickings` and `stock.move`

Forward-Port of #79180
Related to #62139

closes #155910

X-original-commit: e16cd27
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
Co-authored-by: Arnold Moyaux <arm@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants