Commit Graph

772 Commits

Author SHA1 Message Date
Guewen Baconnier
cfa3c8ee1a 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"
2023-07-14 09:20:31 +02:00
Guewen Baconnier
c9878a9c17 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.
2023-07-14 09:20:31 +02:00
Guewen Baconnier
aebb0818b0 Add explicit filter on picking type 2023-07-14 09:20:31 +02:00
Guewen Baconnier
12957cdd52 Improve usability 2023-07-14 09:20:31 +02:00
Guewen Baconnier
5f132e5856 Use optimized method to check if location is child 2023-07-14 09:20:31 +02:00
Guewen Baconnier
5060ba8d11 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
2023-07-14 09:20:30 +02:00
Guewen Baconnier
ec0ad0a7f6 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.
2023-07-14 09:20:30 +02:00
Guewen Baconnier
f5b3d4dec1 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.
2023-07-14 09:20:30 +02:00
Guewen Baconnier
5f596a5775 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.
2023-07-14 09:20:30 +02:00
sebalix
9481c6061b [IMP] stock_reserve_rule: add constraints on fallback locations 2023-07-14 09:20:30 +02:00
Guewen Baconnier
4fd7ef9d2e Run pre-commit with xml prettier 2023-07-14 09:20:30 +02:00
Guewen Baconnier
086db87a38 Migrate stock_reserve_rule to 13.0 2023-07-14 09:20:30 +02:00
Guewen Baconnier
c683bb3251 Add stock_reserve_rule 2023-07-14 09:20:30 +02:00
Francesco Foresti
28d506588c Translated using Weblate (Italian)
Currently translated at 44.1% (15 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
2023-07-12 16:11:57 +00:00
Francesco Foresti
8106d91d3d Translated using Weblate (Italian)
Currently translated at 32.3% (11 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_demand_estimate
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_demand_estimate/it/
2023-07-12 16:11:57 +00:00
OCA-git-bot
7d4a3264df [ADD] setup.py 2023-07-04 14:08:30 +00:00
OCA-git-bot
7f89664feb [UPD] README.rst 2023-07-04 14:08:29 +00:00
OCA-git-bot
be31165509 [UPD] addons table in README.md 2023-07-04 14:08:26 +00:00
oca-ci
cb76ef04d9 [UPD] Update account_move_line_product.pot 2023-07-04 14:03:44 +00:00
OCA-git-bot
9b917da98e Merge PR #1748 into 16.0
Signed-off-by dreispt
2023-07-04 13:59:29 +00:00
OCA-git-bot
d430c826a2 [UPD] addons table in README.md 2023-06-29 23:34:24 +00:00
OCA-git-bot
ff274cee91 stock_reserve 16.0.1.1.0 2023-06-29 23:34:16 +00:00
OCA-git-bot
dd383e2bb0 Merge PR #1780 into 16.0
Signed-off-by pedrobaeza
2023-06-29 23:28:51 +00:00
Víctor Martínez
d4d83c53e5 [FIX] stock_reserve: Set company_id empty from stock_location_reservation to avoid multi-company incompatibilities
TT44108
2023-06-29 09:31:33 +02:00
Weblate
8795bfad1a Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_move_location
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_move_location/
2023-06-27 20:35:36 +00:00
Weblate
f6ec398fbc Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_reserve
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_reserve/
2023-06-27 20:35:36 +00:00
OCA-git-bot
ea256e6e3a [UPD] addons table in README.md 2023-06-27 20:35:15 +00:00
OCA-git-bot
62c08d578b stock_move_location 16.0.1.2.0 2023-06-27 20:35:11 +00:00
OCA-git-bot
fbc8ae23a7 [UPD] README.rst 2023-06-27 20:35:10 +00:00
oca-ci
c308f1fb85 [UPD] Update stock_reserve.pot 2023-06-27 20:31:24 +00:00
oca-ci
e2fd229df8 [UPD] Update stock_move_location.pot 2023-06-27 20:31:21 +00:00
OCA-git-bot
348959aaea Merge PR #1742 into 16.0
Signed-off-by pedrobaeza
2023-06-27 20:28:44 +00:00
dsolanki
b49d07b422 [MIG] account_move_line_product: Migration to 16.0 2023-06-09 17:45:17 +05:30
dsolanki
568e0cb6ba [IMP] account_move_line_product: pre-commit stuff 2023-06-09 17:44:27 +05:30
mymage
d0e598bb65 Translated using Weblate (Italian)
Currently translated at 17.4% (27 of 155 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_reserve
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_reserve/it/
2023-06-09 12:09:14 +00:00
OCA-git-bot
e930c2bede account_move_line_product 15.0.1.0.1 2023-06-08 11:05:24 +05:30
OCA-git-bot
46a75a200a [UPD] README.rst 2023-06-08 11:05:24 +05:30
oca-ci
243e118e0e [UPD] Update account_move_line_product.pot 2023-06-08 11:05:24 +05:30
Juany Davila
d8bb467ddf [MIG] account_move_line_product: Migration to 15.0 2023-06-08 11:05:24 +05:30
OCA-git-bot
68765a6521 [UPD] README.rst 2023-06-08 11:05:24 +05:30
oca-travis
69069b21cd [UPD] Update account_move_line_product.pot 2023-06-08 11:05:24 +05:30
Mantux11
1bb90a67ba [MIG] account_move_line_product: Migration to 14.0 2023-06-08 11:05:24 +05:30
OCA-git-bot
567fb9d18e [IMP] account_move_line_product: black, isort, prettier 2023-06-08 11:05:24 +05:30
OCA-git-bot
86d1d771b6 [UPD] README.rst 2023-06-08 11:05:24 +05:30
mreficent
6c61f3af49 [UPD] Eficent -> ForgeFlow 2023-06-08 11:05:24 +05:30
OCA-git-bot
211a3078a4 pre-commit update 2023-06-08 11:05:24 +05:30
oca-travis
47f1d6a012 [UPD] Update account_move_line_product.pot 2023-06-08 11:05:24 +05:30
ps-tubtim
d47ff1d3ee [MIG] account_move_line_product: Migration to 13.0 2023-06-08 11:05:24 +05:30
ps-tubtim
8ecd5d5028 [IMP] account_move_line_product: black, isort 2023-06-08 11:05:24 +05:30
OCA-git-bot
d50c25efe4 [UPD] README.rst 2023-06-08 11:05:24 +05:30