-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
base: 15.0
Are you sure you want to change the base?
[15.0][IMP]stock_cycle_count: add auto complete and begin adjustments in cron #1997
Conversation
44d4221
to
4c963c0
Compare
4c963c0
to
90fc098
Compare
ee770b8
to
e51735b
Compare
e51735b
to
ff64074
Compare
ff64074
to
09edb8a
Compare
@@ -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( |
There was a problem hiding this comment.
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...
23f01a4
to
e14e801
Compare
09c6757
to
be2ca4a
Compare
be2ca4a
to
28c1195
Compare
inv.action_state_to_in_progress() | ||
try: | ||
inv.action_state_to_in_progress() | ||
except Exception as e: |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
Depends on: #1995
This PR include the following improvements: