-
Notifications
You must be signed in to change notification settings - Fork 289
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
[MIG] stock_by_warehouse: Migration to 17.0 T#79454 #1637
Conversation
@luisg123v please review. |
09692f3
to
982926f
Compare
Missing task ID on PR's title. |
982926f
to
228e1d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is red.
…uxoo#1333) amounts in order to allow js made correct comparations Before: "1,896.00" > 0 === false "896.00" >0 === true After: 1896.00 > 0 === true 896.00 >0 === true
We need avoid using compute fields as possible because of the following issue: - odoo/odoo#30578 warehouses_stock is a computed field used just one time but re-computed too many times: - Opening sale order (one time by each line) - Saving sale order - Choosing a product_id And it computation is more and more slow when the database grows. It is making a big overhead saving sale.order. With this change we have the same behaviour using it just for onchange product_id or forcing from a seudo-button (field boolean) A real button is not used since that it requires save the record to work Using the technical of fields with store=False and onchange methods Check more details from Vauxoo#1358
…fix duplicated quantity from quants (Vauxoo#1364) * [FIX] stock_by_warehouse: Using self._origin from top of methods * [FIX] stock_by_warehouse: Fixing sum quants for serial product NOTE: This code is so ugly, and I don't improvement this part.
The following is performed: - Remove useless test that actually did nothing - Remove data tags from views - Move assets to a separated file - Fix JS - Remove encoding headers from Python files - Split product template and product variant code into two files - Fix typos on the README
A file in /stock_by_warehouse/models was named without the extension, so cannot be used/imported. The extension was just added.
Available quantities were being retrieved not only for the exact location, but also for their child locations. That caused some product to be double-counted when computing quantities. This commit fixes the above.
Adding a new section for the widget `warehouse` that will depend on an option called `by_location`, if is set to True it will allow the user to find all the locations where the product (`product.product`) is available, and the quantity that is in stock. The widget it will allow the user to see the locations and its quantity for each warehouse. And updating the image for the widget by warehouse on the README file.
When there is no available location for a warehouse the set of the most quantity location was giving an error, now if there is no location available a zero will be set indicating it.
Separating the obtain of the locations and their available quantities by warehouse, so the compute `_compute_get_stock_location` is less complicated, also, this information can be used from other methods.
Because we are using `sudo()` we need to make the method called `get_qty_per_location` private.
The following is performed: - Remove decimal precision in float fields - Remove all the decorators @api.multi - Added @api.depends_context in non-stored computer methods, which use context in calls and its super method also uses it
When migration of this module was performed from 12.0 to 13.0 (Vauxoo#1460), some sudo's were removed because we considered them no longer required. However, they actually are, in case there are record rules defined for the warehouse model. Even if the current user doesn't have enough access to see some warehouses, they need to know if there's available stock elsewhere.
- Scrollbar fixed on the stock_by_warehouse_sale widget creating and adding the class .stock-by-warehouse-widget to the scss file and the template.xml: When there was several warehouses for a product, the widget wasn't working correctly and was not showing the scrollbar to check the full list of the stock.
This just a commit to fix indentation on the code
The issue was that the action_confirm takes 2 units of product immediately before action_assign. On v14.0 the products were taken from picking after action_assign. Using action_confirm and action_assign consecutively mantains the original behaviour from the test. This explained behaviour is due to stock.move changes where this model handles action_assign when action_confirm is executed. Functionality is preserved, but the change in the unittest is necessary to follow new behaviour. References: odoo/odoo@a838f2a, https://github.com/odoo/odoo/blob/14.0/addons/stock/models/stock_move.py#L1169 https://github.com/odoo/odoo/blob/15.0/addons/stock/models/stock_move.py#L1239
Minor changes are applied to the code to 16.0, but also, the widget 'warehouse' is migrated to OWL.
…compute functionality
…products This functionality is for storable products to show the information in the warehouses, now this field is invisible for products which are not storable products.
Resolved an issue where multiple locations displayed incorrect stock information due to problematic contexts. By eliminating the cache, we now ensure accurate computation of quantity Units for products. Closes Vauxoo#1633
318e3cc
to
854340b
Compare
@luisg123v please review, comments applied and CI is green. |
FYI @xmglord you can click the "Re-request review" button. |
7b732e2
to
b367eb2
Compare
b367eb2
to
75f4978
Compare
75f4978
to
e3bb94f
Compare
- Simplify the way to define modifiers as states, required, readonly, invisible and column_invisible as part of [1]. - Remove owl="1" from OWL templates, as it's not needed anymore as all of them are OWL now as part of [2]. - Change qty_done to quantity and picked = True as part of [3]. - Adapt use of read_group to _read_group as part of [4]. [1] odoo/odoo#104741 [2] odoo/odoo#130467 [3] odoo/odoo#137864 [4] odoo/odoo#110737
e3bb94f
to
3a9ad7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
invisible and column_invisible as part of [1].
of them are OWL now as part of [2].
[1] odoo/odoo#104741
[2] odoo/odoo#130467
[3] odoo/odoo#137864