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

[14.0][MIG] stock_lock_lot: Migration to 14.0 #831

Merged
merged 22 commits into from
Oct 15, 2021

Conversation

ferran-S73
Copy link
Contributor

Standard migration from 13.0 to 14.0

Lionel Sausin and others added 22 commits April 8, 2021 13:36
In the web client, if you type a new lot name and select "create" from the pop-up menu, the client calls the `create()` method with only the name attribute. All the other fields must be passed in the context.
As a consequence, stock_lock_lot silently failed to block the lots because it didn't find the product.
Fix it by looking for a product id in both the create values and the context.
* Log the reason when a lot is automatically locked

  This is useful whe custom submodules can lock lots for other reasons.

  Additional changes : fix the default value for the blocked checkbox (no big deal, it was overwritten anyway) ; migrate create to api v8 ; use AccessError when permissions are wrong.

* Unreserve quants when blocking lots

  Users block lots when there is a problem with it (eg. quality issue), and it's important that no delivery is made when such a problem is found. So blocking is more important than reservations.
  So, ask for user confirmation when blocking, and then break the reservations.
  Includes translation into French
… on blocked Serial Numbers/lots." is set as True every time the DB is updated
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-workflow-13.0/stock-logistics-workflow-13.0-stock_lock_lot
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-13-0/stock-logistics-workflow-13-0-stock_lock_lot/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-workflow-13.0/stock-logistics-workflow-13.0-stock_lock_lot
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-13-0/stock-logistics-workflow-13-0-stock_lock_lot/
@ferran-S73 ferran-S73 marked this pull request as ready for review June 9, 2021 13:56
Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, IMO a small improvement could be made but not absolutely necessary for a migration.

"""
_locked = product.categ_id.lot_default_locked
categ = product.categ_id.parent_id
while categ and not _locked:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this could be improved with a search using parent_of

@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). 🤖

@simahawk
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-831-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 183845d into OCA:14.0 Oct 15, 2021
@OCA-git-bot
Copy link
Contributor

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

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.