Skip to content
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

[15.0][IMP]stock_cycle_count: add auto complete and begin adjustments in cron #1997

Open
wants to merge 5 commits into
base: 15.0
Choose a base branch
from

Conversation

ArnauCForgeFlow
Copy link

@ArnauCForgeFlow ArnauCForgeFlow commented Apr 17, 2024

Depends on: #1995

This PR include the following improvements:

  • Assign the stock quant's user to the inventory adjustment.
  • Assign the stock quant's date to the inventory adjustment.
  • Enable bulk line changes in the tree view of the stock cycle count.
  • Modify the stock cycle count cron job to automatically validate cycle counts that are planned with a date on or before today, move them to execution and start the inventory adjustment.

@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch 3 times, most recently from 44d4221 to 4c963c0 Compare April 24, 2024 11:14
@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch from 4c963c0 to 90fc098 Compare April 24, 2024 11:57
@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch 3 times, most recently from ee770b8 to e51735b Compare April 29, 2024 14:42
@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch from e51735b to ff64074 Compare May 2, 2024 15:11
@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch from ff64074 to 09edb8a Compare May 2, 2024 15:18
@@ -76,6 +62,27 @@ def _domain_cycle_count_candidate(self):
("location_id", "in", self.location_ids.ids),
]

def _calculate_inventory_accuracy(self):
for inv in self:
sml = self.env["stock.move.line"].search(
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Mmmh, IMHO this has to be refined has multiple searches will be done...

@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch 2 times, most recently from 23f01a4 to e14e801 Compare May 7, 2024 08:55
@ArnauCForgeFlow ArnauCForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch 4 times, most recently from 09c6757 to be2ca4a Compare May 9, 2024 13:30
@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_cycle_count-user_and_date branch from be2ca4a to 28c1195 Compare May 10, 2024 08:01
inv.action_state_to_in_progress()
try:
inv.action_state_to_in_progress()
except Exception as e:
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Isn't it a too broad Exception ?

Moreover, shouldn't we manage the exception in a more elegant manner than 'just' logging ?

Copy link
Author

Choose a reason for hiding this comment

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

Hey @rousseldenis

You might be right. I implemented it this way because we don't want the cron job to stop running due to a validation error from a location that already has an inventory adjustment in progress.

Do you have any suggestions for a better approach?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants