Commit Graph

596 Commits

Author SHA1 Message Date
Guewen Baconnier
bf3e5867dc Remove implicit fallback when rules are used
When rules are configured and have been applied, we should not
have an implicit fallback on the base location, as it would kind
of cancel the benefits of the rules (as it would then take whatever
it wants anywhere in all the locations).
2020-05-28 07:59:43 +02:00
Guewen Baconnier
ffef9da690 Revert "Optimize SQL queries when searching a rule"
This reverts commit 768f186fd2.

Which is not more optimized, the optimization based on parent_path
doesn't make sense here as the ORM will read parent_path in the location
and get the parent ids by splitting the ids, it doesn't need more than
one query on stock_location which is done based on its id and can reuse
the cache, there is no lookup on parent path for parent_of.

>>> env["stock.reserve.rule"].search([("location_id", "parent_of", 3125)])
2020-05-27 05:36:59,938 1 DEBUG log_p odoo.sql_db: query: SELECT "stock_location"."id" as "id","stock_location"."name" as "name","stock_location"."complete_name" as "complete_name","stock_location"."active" as "active","stock_location"."usage" as "usage","stock_location"."location_id" as "location_id","stock_location"."comment" as "comment","stock_location"."parent_path" as "parent_path", <stripped>,"stock_location"."create_uid" as "create_uid","stock_location"."create_date" as "create_date","stock_location"."write_uid" as "write_uid","stock_location"."write_date" as "write_date" FROM "stock_location" WHERE "stock_location".id IN (3125)
2020-05-27 05:36:59,942 1 DEBUG log_p odoo.sql_db: query: SELECT "stock_reserve_rule".id FROM "stock_reserve_rule" WHERE (("stock_reserve_rule"."active" = true)  AND  ("stock_reserve_rule"."location_id" in (1,7,8,133,134,135,144,207,3125))) ORDER BY "stock_reserve_rule"."sequence" ,"stock_reserve_rule"."id"
2020-05-27 07:42:37 +02:00
Guewen Baconnier
0e1487aa49 Remove logger that makes the tests failing
As the logger outputs an error log during tests, travis counts it as a
failure of a test.
2020-05-26 08:52:11 +02:00
Guewen Baconnier
3d977e92e2 Add explicit filter on picking type 2020-05-25 08:30:02 +02:00
Guewen Baconnier
6c8c6c9fd9 Improve usability 2020-05-25 08:28:40 +02:00
Guewen Baconnier
2e5daf1130 Use optimized method to check if location is child 2020-05-20 15:31:18 +02:00
Guewen Baconnier
55bbc44a62 Remove fallback location
It could not work properly here as we need the "fallback" to apply
even if there is no quantity at all in the stock. As we hook the
reservation rules in StockMove._update_reserved_quantity(), and
this method is called only if we have at least 1 product in qty,
the fallback was not applied with zero qty.

A new module will handle this concept: https://github.com/OCA/wms/pull/28
2020-05-20 15:31:18 +02:00
Guewen Baconnier
768f186fd2 Optimize SQL queries when searching a rule
Searching all rules then filtering in python the parent path is
more efficient than finding all the parent locations and finding
the matching rules.
2020-05-15 12:16:32 +02:00
Guewen Baconnier
89e4ea230f Fix application of removal rules too broad
Example of configuration:

Rule location: Stock
Removal rule 1: Stock/Zone1
Removal rule 2: Stock/Zone2

Reservation of a stock move with Stock/Zone2 as source location.

Previously, it would reserve in Stock/Zone1.
Now, it will never be allowed to reserve in Stock/Zone1.

A warning message was added previously to warn the user about potential
issues, which is now obsolete so I removed it.
2020-05-15 08:03:12 +02:00
Guewen Baconnier
c99c97ffa4 Fix bug in fallback when no quantity could be reserved
Before the change, the implementation of the fallback goes like this:

If I reserve a move of 3000 and it finds 600 units, it splits the move
to create a new move of 2400 and pretend to the caller that 3000 was
reserved so the initial move is changed to 'assigned'.

Now, if we have a move of 2400 and finds zero, it still splits the move,
and pretend to the caller that 2400 was reserved → the initial move has
no move line but is assigned. In this case, we should not split the move
but only update the source location of the move.
2020-05-14 16:08:21 +02:00
sebalix
4e4d2d7130 [IMP] stock_reserve_rule: add constraints on fallback locations 2020-04-30 10:18:45 +02:00
Guewen Baconnier
13a274e8f0 Run pre-commit with xml prettier 2020-03-23 11:36:31 +01:00
Guewen Baconnier
7a43a1c67d Migrate stock_reserve_rule to 13.0 2020-03-17 10:39:10 +01:00
Guewen Baconnier
3494c2671d Add stock_reserve_rule 2020-03-17 10:39:10 +01:00
OCA Transbot
2593bcfb2d Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_request
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request/
2020-03-14 11:28:56 +00:00
OCA-git-bot
c69ac2f39b pre-commit update 2020-03-14 12:28:39 +01:00
OCA Transbot
785a275638 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_orderpoint_purchase_link
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_orderpoint_purchase_link/
2020-03-12 13:21:48 +00:00
OCA-git-bot
8a0344a196 [ADD] setup.py 2020-03-12 13:21:37 +00:00
OCA-git-bot
5a3f5280e3 [UPD] README.rst 2020-03-12 13:21:37 +00:00
oca-travis
de6f1d6ced [UPD] Update stock_request.pot 2020-03-12 12:59:29 +00:00
OCA-git-bot
202aac9174 Merge PR #839 into 13.0
Signed-off-by LoisRForgeFlow
2020-03-12 12:49:23 +00:00
OCA-git-bot
08fe2c9977 [ADD] setup.py 2020-03-11 13:34:00 +00:00
OCA-git-bot
01e98b76e2 [UPD] README.rst 2020-03-11 13:34:00 +00:00
oca-travis
bc61116791 [UPD] Update stock_orderpoint_purchase_link.pot 2020-03-11 13:07:00 +00:00
OCA-git-bot
b901adaaf5 Merge PR #857 into 13.0
Signed-off-by LoisRForgeFlow
2020-03-11 12:57:08 +00:00
Joan Sisquella
5fba3f27c3 [MIG] stock_orderpoint_purchase_link: Migration to 13.0 2020-03-11 08:46:56 +01:00
Joan Sisquella
05066f59de [IMP] stock_orderpoint_purchase_link: black, isort 2020-03-11 08:46:56 +01:00
OCA Transbot
995cc51caa Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_orderpoint_purchase_link
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_orderpoint_purchase_link/
2020-03-11 08:46:56 +01:00
oca-travis
7922c054f0 [UPD] Update stock_orderpoint_purchase_link.pot 2020-03-11 08:46:56 +01:00
黎伟杰
1b3b19002a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (5 of 5 strings)

Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_orderpoint_purchase_link
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_orderpoint_purchase_link/zh_CN/
2020-03-11 08:46:56 +01:00
黎伟杰
91300bd425 Added translation using Weblate (Chinese (Simplified)) 2020-03-11 08:46:56 +01:00
OCA-git-bot
c4f7023292 [UPD] README.rst 2020-03-11 08:46:56 +01:00
oca-travis
a35925d6da [UPD] Update stock_orderpoint_purchase_link.pot 2020-03-11 08:46:56 +01:00
Kitti U
85db0df9b0 [12.0][MIG] stock_orderpoint_purchase_link 2020-03-11 08:46:56 +01:00
oca-travis
b3c3da92fc [UPD] Update stock_orderpoint_purchase_link.pot 2020-03-11 08:46:56 +01:00
Maxime Chambreuil
0febddef95 Update __manifest__.py 2020-03-11 08:46:56 +01:00
oca-travis
e4026bdc30 [UPD] Update stock_orderpoint_purchase_link.pot 2020-03-11 08:46:56 +01:00
Lois Rilo
0719b28828 [11.0][FIX] stock_orderpoint_purchase_link:
* update PO line passes orderpoints
 * add tests
2020-03-11 08:46:56 +01:00
Lois Rilo
d3d474536c [11.0] stock_orderpoint_purchase_link: add corresponding field to PO lines on orderpoint 2020-03-11 08:46:56 +01:00
Bhavesh Odedra
202028d183 remove unused api from imported 2020-03-11 08:46:56 +01:00
Jordi Ballester Alomar
b1c61973e2 add stock_orderpoint_move_link and stock_orderpoint_purchase_link 2020-03-11 08:46:56 +01:00
OCA-git-bot
bae4fb7f2e [ADD] setup.py 2020-03-10 17:00:41 +00:00
OCA-git-bot
41e77c5da3 [UPD] README.rst 2020-03-10 17:00:41 +00:00
oca-travis
ce08f10bcf [UPD] Update stock_orderpoint_move_link.pot 2020-03-10 15:45:39 +00:00
OCA-git-bot
a48883b17c Merge PR #823 into 13.0
Signed-off-by LoisRForgeFlow
2020-03-10 14:02:41 +00:00
OCA Transbot
fe5f0b06a4 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_inventory_discrepancy
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_inventory_discrepancy/
2020-03-04 08:01:22 +00:00
OCA-git-bot
a72d8d714d [ADD] setup.py 2020-03-04 08:01:11 +00:00
OCA-git-bot
601c7d0872 [UPD] README.rst 2020-03-04 08:01:11 +00:00
oca-travis
be2239b058 [UPD] Update stock_location_position.pot 2020-03-04 07:42:46 +00:00
OCA-git-bot
0b95190d32 Merge PR #805 into 13.0
Signed-off-by ps-tubtim
2020-03-04 07:33:08 +00:00