Skip to content

Conversation

pedrobaeza
Copy link
Collaborator

@pedrobaeza pedrobaeza commented Aug 13, 2021

With previous code, the call to super is done before doing all the producing stuff, so the consumption takes place before the stock is available. This is not a problem if you don't have any kind of negative stock levels control, as first a negative quant is created, and when the production is done, the negative quant is neutralized.

But if you start using the OCA module stock_no_negative, then the negative stock exception raises, and you are not able to finish the subcontracting reception.

Swapping the super call order, means another thing: the backorder is created after the producing code, so we need to filter out the lines that are not being received.

A new test has been included for checking the partial reception flow.

@Tecnativa TT31389

@pedrobaeza pedrobaeza added Logistics about stock, mrp, delivery, purchase 13.0 labels Aug 13, 2021
@robodoo
Copy link
Contributor

robodoo commented Aug 13, 2021

Pull request status dashboard

@pedrobaeza
Copy link
Collaborator Author

@amoyaux Can you please take a look to this?

Another fix coming soon.

@C3POdoo C3POdoo requested a review from a team August 13, 2021 08:28
@pedrobaeza pedrobaeza force-pushed the 13.0-mrp_subcontracting-produce_before_consumption branch from 4e8dc72 to ac68541 Compare August 13, 2021 09:49
@pedrobaeza

This comment has been minimized.

@pedrobaeza pedrobaeza force-pushed the 13.0-mrp_subcontracting-produce_before_consumption branch 2 times, most recently from 630ac5f to 2bf5017 Compare August 13, 2021 10:08
@pedrobaeza
Copy link
Collaborator Author

@amoyaux can you please take a look to this?

@kos94ok-3D
Copy link
Contributor

Try to remove this part of the code:
image

@pedrobaeza
Copy link
Collaborator Author

Thanks for the tip. Aren't we causing a problem with that? Why it should be removed?

@pedrobaeza pedrobaeza force-pushed the 13.0-mrp_subcontracting-produce_before_consumption branch from 32b35ca to e4557ff Compare March 8, 2022 16:39
@kos94ok-3D
Copy link
Contributor

As I understand, when we do overprocess for subcontract receipt and then close subcontract MO it is needed in order to set new qty to produce in Subcontract MO.
But when we first close subcontract MO and then close subcontract receipt it is already done and not needed.
So this part duplicate overprocessed quantity.

@pedrobaeza pedrobaeza force-pushed the 13.0-mrp_subcontracting-produce_before_consumption branch from e4557ff to e9a8942 Compare March 8, 2022 17:50
@pedrobaeza
Copy link
Collaborator Author

@kos94ok-3D your reasoning seems correct. Thanks.

@amoyaux this one is ready.

With previous code, the call to super is done before doing all the
producing stuff, so the consumption takes place before the stock is
available. This is not a problem if you don't have any kind of negative
stock levels control, as first a negative quant is created, and when the
production is done, the negative quant is neutralized.

But if you start using the OCA module stock_no_negative, then the
negative stock exception raises, and you are not able to finish
the subcontracting reception.

Swapping the super call order, means another thing: the backorder is
created after the producing code, so we need to filter out the lines
that we are not being received.

A new test has been included for checking the partial reception flow.

@Tecnativa TT75065
@pedrobaeza pedrobaeza force-pushed the 13.0-mrp_subcontracting-produce_before_consumption branch from e9a8942 to 721b495 Compare September 4, 2022 18:57
@C3POdoo
Copy link
Contributor

C3POdoo commented Mar 30, 2023

Dear @pedrobaeza,

Thank you for your contribution but the version 13.0 is no longer supported.
We only support the last 3 stable versions so no longer accepts patches into this branch.

We apology if we could not look at your request in time.
If the contribution still makes sense for the upper version, please let us know and do not hesitate to recreate one for the recent versions. We will try to check it as soon as possible.

This is an automated message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
13.0 Logistics about stock, mrp, delivery, purchase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants