Conversation
…of a location, the rules of the parents are also allowed
- Error with the sequence number. - Visible texts that should be in uppercases. - order_id should only be visible if group_stock_request_order option is enabled. - adds more tests - adds consistency between models company-wise
This commit allows the user to select multiple products from a product list view and to create a Stock Request Order with an action. If the user selects templates, all of those templates' variants will be added to the order. This is useful as it allows the user to filter products beforehand based on their stocks, and to create a request order for all those products whose stock is too low.
Currently translated at 57.1% (72 of 126 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request/de/
* Add readme autogenerated * Add some hooks * Improve test inheritance (reduce testing time) * Don't allow qty <= 0 * SR expected_date = order expected_date if SRO
Currently translated at 80.9% (131 of 162 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request/de/
copied when duplicating a stock request order.
Currently translated at 3.1% (5 of 162 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-request-18.0/stock-logistics-request-18.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-request-18-0/stock-logistics-request-18-0-stock_request/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-request-18.0/stock-logistics-request-18.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-request-18-0/stock-logistics-request-18-0-stock_request/
…perations and improves in stock.view_move_form
Currently translated at 97.6% (169 of 173 strings) Translation: stock-logistics-request-18.0/stock-logistics-request-18.0-stock_request Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-request-18-0/stock-logistics-request-18-0-stock_request/tr/
4627857 to
7c0a905
Compare
7c0a905 to
afa4e0a
Compare
AaronHForgeFlow
left a comment
There was a problem hiding this comment.
I did a functional review. It works well but I found an issue, that is probably affecting other versions of the module:
Steps to Reproduce
Setup:
Create a custom route to internally supply a location in the warehouse:
Rule 1: Pull from Location A to Location B (Procure Method: "Take from stock, if unavailable, trigger another rule")
Rule 2: Buy to Location A (standard Buy rule )
Create a product with this that route enabled
Set stock quantity in Location A to 3 units
Reproduce:
Create a stock request for 10 units to Location B
Confirm the stock request
Expected Result:
Internal transfer created for 3 units (available stock)
Purchase Order created for 7 units (shortage)
PO line linked to stock request via stock_request_ids
Actual Result:
- Internal transfer created for 3 units
- Purchase Order created for 7 units
- PO line NOT linked to stock request --> This is not happening
I tested it together with the stock_request_purchase module. However, because potentially there it could be more chained rules than the scenario above I consider it is not harmful to include the code in the base module. I can propose the 'fix' to a previous version if you prefer that.
| permissions (example: productions).""" | ||
| res = super()._action_done(cancel_backorder=cancel_backorder) | ||
| self.mapped("allocation_ids.stock_request_id").sudo().check_done() | ||
| return res |
There was a problem hiding this comment.
Can you add this code here? Reason explained in the review main comment.
def _prepare_procurement_values(self):
"""Propagate stock_request_ids when creating procurement from moves"""
values = super()._prepare_procurement_values()
if self.stock_request_ids:
values["stock_request_id"] = self.stock_request_ids[0].id
return values
| for allocation in request.allocation_ids: | ||
| if allocation.stock_move_id.picking_code == "incoming": | ||
| incoming_qty += allocation.allocated_product_qty | ||
| else: | ||
| other_qty += allocation.allocated_product_qty |
There was a problem hiding this comment.
| for allocation in request.allocation_ids: | |
| if allocation.stock_move_id.picking_code == "incoming": | |
| incoming_qty += allocation.allocated_product_qty | |
| else: | |
| other_qty += allocation.allocated_product_qty | |
| for allocation in request.allocation_ids: | |
| if allocation.stock_move_id.move_dest_ids: | |
| continue | |
| if allocation.stock_move_id.picking_code == "incoming": | |
| incoming_qty += allocation.allocated_product_qty | |
| else: | |
| other_qty += allocation.allocated_product_qty |
Not due to this PR, but an issue that is present in v18 as well. Stock request qty_done was incorrectly calculated when using multi-step routes (e.g., Stock → Transit → Destination) because intermediate moves in the chain were counted, causing them to cancel each other out.
Solution: Skip moves that have move_dest_ids (intermediate moves in chain), only count the final destination move.
|
Hello @AaronHForgeFlow , thank you for the review! The issue(s) you are describing are valid but I'm wondering if the second issue (counting allocations of the intermediate moves) is not result of your fix to the first issue (propagating the stock_request_id in case of multi step routes). If we propagate the stock_request_id this will mean an allocation will be created for all moves in the chain https://github.com/OCA/stock-logistics-request/blob/18.0/stock_request/models/stock_rule.py#L31. So this will create links to the stock_request which is then causing the issue in the _compute_qty method (could be in other places too). I'm wondering if this should be checked by the repo/module maintainers first. Perhaps it is best to track this in a separate PR and let others review it (including me!). |
|
@kirca I see, the fixes proposed have some side effects. Perhaps we can discard them for now but put them in the readme as known issues. |
|
@AaronHForgeFlow I've updated the roadmap with the issue and a possible solution |
No description provided.