Skip to content

Conversation

@PicchiSeba
Copy link

@PicchiSeba PicchiSeba commented Sep 27, 2024

This module was originally from https://github.com/OCA/stock-logistics-warehouse/tree/14.0/ but for 16.0 it has been moved to this repo

JordiBForgeFlow and others added 23 commits August 26, 2024 10:34
To avoid executing the setup for each test
* performance (less queries executed)
* disable tracking in tests (faster)
* use with_user instead of sudo
* the double for loop in _compute_route_ids actually generates one more
  query as the simple one in this commit (thanks to the cache)
* extract a method
* the parent locations can be found using 'parent_of' which will use the
  parent_path under the hood (example: 1/7/8 will return locations 1, 7,
  8)

[UPD] Update stock_orderpoint_route.pot
[UPD] Update stock_orderpoint_route.pot
This is to avoid issue below for any module that inherits tree view of
the model `stock.warehouse.orderpoint`. Example: `stock_orderpoint_manual_procurement`

Field route_ids used in field route_id default domain
([('id', 'in', route_ids)]) must be present in view but is missing.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-14.0/stock-logistics-warehouse-14.0-stock_orderpoint_route
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_orderpoint_route/
@PicchiSeba PicchiSeba force-pushed the 16.0-mig-stock_orderpoint_route branch from 59c57c6 to 6688005 Compare September 27, 2024 15:11
@PicchiSeba PicchiSeba marked this pull request as ready for review September 27, 2024 15:13
Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

@rousseldenis
Copy link
Contributor

/ocabot migration stock_orderpoint_route

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Sep 27, 2024
@OCA-git-bot
Copy link
Contributor

There's no issue in this repo with the title 'Migration to version 16.0' and the milestone 16.0, so not possible to add the comment.

Copy link
Member

@yvaucher yvaucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks you @PicchiSeba

@yvaucher
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-23-by-yvaucher-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Sep 30, 2024
Signed-off-by yvaucher
@OCA-git-bot
Copy link
Contributor

@yvaucher your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-23-by-yvaucher-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@yvaucher
Copy link
Member

yvaucher commented Sep 30, 2024

@PicchiSeba seems the merge failed due to the following error:

2024-09-30 13:42:03,203 259 ERROR odoo odoo.addons.stock_location_orderpoint.tests.test_location_orderpoint: ERROR: TestLocationOrderpoint.test_cron_replenishment
Traceback (most recent call last):
  File "/__w/stock-logistics-orderpoint/stock-logistics-orderpoint/stock_location_orderpoint/tests/test_location_orderpoint.py", line 99, in test_cron_replenishment
    tomorrow = now.replace(day=now.day + 1)
ValueError: day is out of range for month

I would advice to use freezegun to get a fixed date in the tests. It most likely fails because today is the 30 september and tomorrow is not the 31 of september ;)

Or you can more simply use fields.Date.add(today, days=1) (thanks @sebalix for the tip)

@PicchiSeba
Copy link
Author

PicchiSeba commented Oct 1, 2024

@PicchiSeba seems the merge failed due to the following error:

2024-09-30 13:42:03,203 259 ERROR odoo odoo.addons.stock_location_orderpoint.tests.test_location_orderpoint: ERROR: TestLocationOrderpoint.test_cron_replenishment
Traceback (most recent call last):
  File "/__w/stock-logistics-orderpoint/stock-logistics-orderpoint/stock_location_orderpoint/tests/test_location_orderpoint.py", line 99, in test_cron_replenishment
    tomorrow = now.replace(day=now.day + 1)
ValueError: day is out of range for month

I would advice to use freezegun to get a fixed date in the tests. It most likely fails because today is the 30 september and tomorrow is not the 31 of september ;)

Or you can more simply use fields.Date.add(today, days=1) (thanks @sebalix for the tip)

The problem lies in the stock_location_orderpoint module. In particular line 99 of tests/test_location_orderpoint.py


This statement will always fail if we test on the last day of the month

@PicchiSeba
Copy link
Author

@yvaucher we can merge this now. Later in the day I will fix the base module test

@yvaucher
Copy link
Member

yvaucher commented Oct 1, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-23-by-yvaucher-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 26f9f3c into OCA:16.0 Oct 1, 2024
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at a471175. Thanks a lot for contributing to OCA. ❤️

@PicchiSeba PicchiSeba deleted the 16.0-mig-stock_orderpoint_route branch October 1, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.