Skip to content

[FIX] mrp: split call to write on stock move#69377

Closed
Whenrow wants to merge 1 commit intoodoo:14.0from
odoo-dev:14.0-reservation-sync-mrp-whe
Closed

[FIX] mrp: split call to write on stock move#69377
Whenrow wants to merge 1 commit intoodoo:14.0from
odoo-dev:14.0-reservation-sync-mrp-whe

Conversation

@Whenrow
Copy link
Copy Markdown
Contributor

@Whenrow Whenrow commented Apr 16, 2021

You can, in a production order, change the quantity done of a stock move
raw and change its initial demand ('To Consume' field) in the same
transaction. This can lead to some issue as changing the quantity done
will update the stock move line and changing the initial demand will
unreserve the stock move thus impacting the stock move lines too.

This commit will split the values to update of a stock in move in case
the two fields have to be updated. First the stock move lines, then the
initial demand.

opw : 2451298

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@Whenrow Whenrow requested a review from a team as a code owner April 16, 2021 09:36
@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Apr 16, 2021

Pull request status dashboard

@Whenrow Whenrow force-pushed the 14.0-reservation-sync-mrp-whe branch from b6b533f to e24cb44 Compare April 16, 2021 09:54
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 16, 2021
@Whenrow Whenrow force-pushed the 14.0-reservation-sync-mrp-whe branch 2 times, most recently from d2f31f2 to 0f09f19 Compare April 16, 2021 14:56
@agr-odoo
Copy link
Copy Markdown
Contributor

@Whenrow Hello, this looks good now, could we move forward or is there something else left to do?

@agr-odoo
Copy link
Copy Markdown
Contributor

robodoo r+

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented May 10, 2021

Unable to stage PR ({"message":"Merge conflict","documentation_url":"https://docs.github.com/rest/reference/repos#merge-a-branch"})

You can, in a production order, change the quantity done of a stock move
raw and change its initial demand ('To Consume' field) in the same
transaction. This can lead to some issue as changing the quantity done
will update the stock move line and changing the initial demand will
unreserve the stock move thus impacting the stock move lines too.

This commit will split the values to update of a stock in move in case
the two fields have to be updated. First the stock move lines, then the
initial demand.

This commit also remove the default_product_uom_qty in the move_raw_ids
fields. This ensure the onchanges do not create/edit any stock move lines
with some reserved quantity.

opw : 2451298
@agr-odoo agr-odoo force-pushed the 14.0-reservation-sync-mrp-whe branch from 0f09f19 to 83d53fd Compare May 10, 2021 14:40
@agr-odoo
Copy link
Copy Markdown
Contributor

robodoo retry

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented May 11, 2021

I'm sorry, @agr-odoo. Retry makes no sense when the PR is not in error.

@agr-odoo
Copy link
Copy Markdown
Contributor

robodoo r+

@robodoo robodoo closed this in d1e4972 May 11, 2021
@robodoo robodoo temporarily deployed to merge May 11, 2021 15:59 Inactive
@fw-bot
Copy link
Copy Markdown
Contributor

fw-bot commented May 15, 2021

This pull request has forward-port PRs awaiting action (not merged or closed): #70702

3 similar comments
@fw-bot
Copy link
Copy Markdown
Contributor

fw-bot commented May 16, 2021

This pull request has forward-port PRs awaiting action (not merged or closed): #70702

@fw-bot
Copy link
Copy Markdown
Contributor

fw-bot commented May 17, 2021

This pull request has forward-port PRs awaiting action (not merged or closed): #70702

@fw-bot
Copy link
Copy Markdown
Contributor

fw-bot commented May 18, 2021

This pull request has forward-port PRs awaiting action (not merged or closed): #70702

amoyaux added a commit to odoo-dev/odoo that referenced this pull request Nov 5, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139
amoyaux added a commit to odoo-dev/odoo that referenced this pull request Nov 29, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139
amoyaux added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139
robodoo pushed a commit that referenced this pull request Dec 9, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
#69377
#66347
#61758
#54355
#43180
#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to #62139

closes #79180

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
amoyaux added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139

X-original-commit: d99e173
robodoo pushed a commit that referenced this pull request Dec 9, 2021
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
#69377
#66347
#61758
#54355
#43180
#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to #62139

closes #81127

X-original-commit: d99e173
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
odooaktiv pushed a commit to odooaktiv/odoo that referenced this pull request Jun 13, 2022
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139

closes odoo#81127

X-original-commit: d99e173
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
antonioburic pushed a commit to VanMoof/odoo that referenced this pull request Jul 31, 2022
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139

closes odoo#79180

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
sergiocorato pushed a commit to efatto/OCB that referenced this pull request Sep 15, 2022
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo#69377
odoo#66347
odoo#61758
odoo#54355
odoo#43180
odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo#62139

closes odoo#81127

X-original-commit: d99e173
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Jan 11, 2023
It happens that the `stock.quant.reserved_quantity` and `stock.move.line.product_qty`
for the same parameters are not equals (due to some bugs in the past)

It could implies that it doesn't exist enough reserved quantity on the
quant when a user try to unreserve a stock.move.line resulting in the
UserError 'It is not possible to unreserve more products of %s than you
have in stock'

However on current stable version (13.0 and 14.0) a lot of PR already
fixed a lot of issue as:
odoo/odoo#69377
odoo/odoo#66347
odoo/odoo#61758
odoo/odoo#54355
odoo/odoo#43180
odoo/odoo#70975
for example (there is more than that)

So the idea is to provide a way to unlock the database manually for
stable but not in the new version to be able to analyse them and find
possible bugs responssible for the desynchronization.

The server action check 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 `pickings` and
`stock.move`

related to odoo/odoo#62139

closes odoo/odoo#79180

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants