Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][ADD] mrp_subcontracting_no_negative #878

Merged

Conversation

sebalix
Copy link
Contributor

@sebalix sebalix commented Oct 19, 2022

Same feature than stock_no_negative but dedicated to subcontracting. It doesn't allow the record of components on a subcontractor receipt if they can't be reserved, so we can't get negative stock levels in subcontractor locations.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 26, 2023
@github-actions github-actions bot closed this Apr 2, 2023
@grindtildeath
Copy link
Contributor

@OCA/manufacturing-maintainers Can we please keep this one open as well?

@pedrobaeza pedrobaeza reopened this Apr 20, 2023
@pedrobaeza pedrobaeza removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 20, 2023
@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 15.0-ocabot-merge-pr-878-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ef9821d into OCA:15.0 Apr 20, 2023
@OCA-git-bot
Copy link
Contributor

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

@AungKoKoLin1997
Copy link
Contributor

I tried to use this module.Then, I noticed this module's function is covered by stock_no_negative, isn't it? I knew there is a issue when validating subcontracting receipts in stock_no_negative. If we use these two modules together, the issue is still exit. If we fix the issue in stock_no_negative for subcontracting receipts, we don't need to use mrp_subcontracting_no_negative and cover this module's function.
May be I am missing about the background reason of adding this new module.
I am planning to fix the issue in stock_no_negative. Please let me know if there is the anything I missed.

@sebalix
Copy link
Contributor Author

sebalix commented May 2, 2023

@AungKoKoLin1997 Can we fix the subcontracting stock level issue in stock_no_negative without adding a dependency on mrp_subcontracting? (we want to avoid that)
Also, stock_negative_qty constraint is triggered when the quantity field of the quant is updated, in a context of subcontracting the error message arrives too late to the user I guess (I don't remember exactly, but it's probably why stock_no_negative is not yet triggered when recording the components on the stock transfer).

Another use case is we want to allow negative stock here and there, but disallow it only for subcontractor locations (only mrp_subcontracting_no_negative installed).

Of course if you find a way to make stock_no_negative working when we are recording components on a subcontractor stock transfer, it is very welcome so we won't need to maintain this one anymore (if we forget the other use case I mentioned, I saw we can configure locations in this regard).

@pedrobaeza pedrobaeza added this to the 15.0 milestone May 2, 2023
@pedrobaeza
Copy link
Member

The root problem is described in odoo/odoo#75065

@AungKoKoLin1997
Copy link
Contributor

AungKoKoLin1997 commented May 2, 2023

@sebalix @pedrobaeza

Can we fix the subcontracting stock level issue in stock_no_negative without adding a dependency on mrp_subcontracting?

Yes. I know we can’t fix without adding a dependency on mrp_subcontracting. What I mentioned was we need to fix stock_no_negative for subcontracting receipts. So, my thought was instead of adding this feature in this module, we can create new module that depends on stock_no_negative to fix subcontracting stock level issue. If we create that new module, the function of mrp_subcontracting_no_negative will be covered automatically.

I don't remember exactly, but it's probably why stock_no_negative is not yet triggered when recording the components on the stock transfer

If I am not wrong, stock_no_negative is not triggered when recording the components on the stock transfer because it will not create any negative stock.quant during record components. It will create negative stock.quant when we validate subcontracting receipts. So, it will be shown validation error message for component products when we click validate button.

So, I was thinking we should skip no negative check for finished product in subcontracting receipts. But the workflow will be the same for component products.
Here is my outcome:

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.

7 participants