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

[MASTER][IMP] Inventory Adjustment Usability #32613

Closed
wants to merge 5 commits into from

Conversation

svs-odoo
Copy link
Contributor

Description of the feature this PR addresses:

Improve the usability of the Inventory Adjustments and allow to easily correct a product quantity without going through an Inventory Adjustment.

See commit messages for more information.

Task #1935921

@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Apr 11, 2019
@C3POdoo C3POdoo added the RD research & development, internal work label Apr 11, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 11, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 12, 2019
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Apr 12, 2019
@svs-odoo
Copy link
Contributor Author

@sle-odoo I pushed changes you asked for in the old PR. I didn't create test for performance as inventory line's field outdated is computed now.

@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Apr 16, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 17, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 17, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 18, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 18, 2019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 23, 2019
svs-odoo and others added 5 commits May 29, 2019 15:59
Made some changes in stock.quant model to allow user to modify product
quantity easier.

To allow the edition of quant without opening more permissions on the
model, we switch to sudo in create mode and write if the conditions are
met (special key in context + access rights on the current user + write
on a specific field).
Also, we have two list views for the quant:
    - The old list view who still readonly.
    - A new list view where user can create new quant or edit quantity
    of existing ones

We display the second one if user is a stock manager.
For existing quants, user can modify counted quantity (which will modify
product quantity). User can also create new quant, in this case:
    - The quant is really a new one (ex.: new product/location
    association) so will simply create a new quant.
    - A corresponding quant already exist, so will modify the existing
    quant instead of create a new one.

When an user creates a new quant, the model will check each time a
non-quantity field (product, location, SN/LN, package or owner) is
modified to see if corresponding quant exists. In this case, it'll get
the quant ID and will update reserved and on hand quantities.
If user didn't change the inventory quantity, it'll be updated too.

On product form view, the 'Update quantity' button was removed as user
can now simply modify quant with 'On Hand' stat button.

Task #1935921

Co-authored-by: sle-odoo <sle@odoo.com>
Change the use of Inventory Adjustment, notable changes are:

    - Removed filter field: When user creates a new inventory
    adjustment, he can set one or multiple locations and/or products.
    An inventory adjustment will worry only about defined
    locations/products, but if neither product or location was set,
    it'll manage all stock.

    - Inventory Adjustment Lines have their own view instead of be
    listed on the Inventory Adjustment form view.
    Inventory adjustment lines have new color legend:
        - Red: The quantity is outdated.
        - Blue: There is difference between the on hand quantity and the
        counted quantity.
    New inventory lines created by the user are written in bold.

    - User can't modify already existing inventory lines, except for the
    counted quantity.

    - When an inventory line is outdated, the user has the possibility
    to select and update it, that'll recompute the on hand quantity.

    - When an inventory adjustment is validated, it will take in account
    only the difference between the theoretical quantity ('On Hand
    Quantity') and the counted quantity to adjust the quants.

    - When an inventory adjustment is canceled, it will keep its
    inventory lines and won't regenerate them when re-started.

    - When an Inventory Adjustment generates Account Moves, user can now
    find them in a stat button in the Inventory Adjustment form view.

Also, made some changes in demo data to match new requirement.

Task #1935921
Creation of a js_class: singleton_list.
It's used in the quant list view and its purpose is to avoid duplicate
line in list editable.

When user creates a new record, if the server responses with a ID
corresponding to a record already present in the view, it'll update the
old one instead of create a duplicate line.

Task #1935921
Before this commit, we had two form views for production lot: one more
complete and one simplier.
The complete one was displayed when we come from the prod lot list view,
and the simplier one in any other case.

But actually, we need to display the simplier one only with "Create and
Edit" and display the complete one in any other case, but it's
impossible to do with only two distinguish views.

So, we keep only one view with all elements and we display or hide some
fields or button in function of the context or if the record is new.

Task #1935921
In List View, the Import button is placed after the Create button.

Before this commit, in a list editable in edit mode, the Create button
is hidden and the Save & Discard buttons are displayed.
But as the Create button was placed before the Save button, the Import
button will appear at the first position.

With this commit, the Create button is now placed after the Discard
button. In this way the Import button will be always the last button and
its position will not change when we switch between edit and read modes.
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed r+ 👌 labels May 29, 2019
@sle-odoo
Copy link
Contributor

robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented May 29, 2019

Merge method set to rebase and fast-forward

@robodoo robodoo added merging 👷 and removed r+ 👌 CI 🤖 Robodoo has seen passing statuses labels May 29, 2019
@robodoo
Copy link
Contributor

robodoo commented May 29, 2019

Staging failed: timed out (>120 minutes)

@d-fence
Copy link
Contributor

d-fence commented May 29, 2019

@robodoo retry

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses r+ 👌 and removed error 🙅 labels May 29, 2019
robodoo pushed a commit that referenced this pull request May 29, 2019
In List View, the Import button is placed after the Create button.

Before this commit, in a list editable in edit mode, the Create button
is hidden and the Save & Discard buttons are displayed.
But as the Create button was placed before the Save button, the Import
button will appear at the first position.

With this commit, the Create button is now placed after the Discard
button. In this way the Import button will be always the last button and
its position will not change when we switch between edit and read modes.

closes #32613

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
@robodoo
Copy link
Contributor

robodoo commented May 29, 2019

Merged, thanks!

@robodoo robodoo closed this May 29, 2019
@sle-odoo sle-odoo deleted the master-stock-stuff-sle branch September 9, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants