-
-
Notifications
You must be signed in to change notification settings - Fork 209
[16.0][FIX] shopfloor: Fetch qty_available only when needed #1055
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
base: 16.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -97,7 +97,7 @@ def _response_for_start_line( | |||||||||||||||||
| self, move_line, message=None, popup=None, sublocation=None | ||||||||||||||||||
| ): | ||||||||||||||||||
| kw = {"sublocation": self.data.location(sublocation)} if sublocation else {} | ||||||||||||||||||
| data = self._data_move_line(move_line, **kw) | ||||||||||||||||||
| data = self._data_move_line(move_line, no_qty_available=True, **kw) | ||||||||||||||||||
| return self._response( | ||||||||||||||||||
| next_state="start_line", | ||||||||||||||||||
| data=data, | ||||||||||||||||||
|
|
@@ -107,9 +107,14 @@ def _response_for_start_line( | |||||||||||||||||
|
|
||||||||||||||||||
| def _response_for_scan_destination(self, move_line, message=None, qty_done=None): | ||||||||||||||||||
| if qty_done is None: | ||||||||||||||||||
| data = self._data_move_line(move_line) | ||||||||||||||||||
| data = self._data_move_line( | ||||||||||||||||||
| move_line, | ||||||||||||||||||
| no_qty_available=True, | ||||||||||||||||||
| ) | ||||||||||||||||||
| else: | ||||||||||||||||||
| data = self._data_move_line(move_line, qty_done=qty_done) | ||||||||||||||||||
| data = self._data_move_line( | ||||||||||||||||||
| move_line, no_qty_available=True, qty_done=qty_done | ||||||||||||||||||
| ) | ||||||||||||||||||
| last_picked_line = self._last_picked_line(move_line.picking_id) | ||||||||||||||||||
| if last_picked_line: | ||||||||||||||||||
| # suggest pack to be used for the next line | ||||||||||||||||||
|
|
@@ -406,9 +411,10 @@ def _data_move_line(self, line, **kw): | |||||||||||||||||
| data["batch"] = self.data.picking_batch(batch) | ||||||||||||||||||
| data["picking"] = self.data.picking(picking) | ||||||||||||||||||
| data["postponed"] = line.shopfloor_postponed | ||||||||||||||||||
| data["product"]["qty_available"] = product.with_context( | ||||||||||||||||||
| location=line.location_id.id | ||||||||||||||||||
| ).qty_available | ||||||||||||||||||
| if "no_qty_available" not in kw or not kw.get("no_qty_available"): | ||||||||||||||||||
| data["product"]["qty_available"] = product.with_context( | ||||||||||||||||||
| location=line.location_id.id | ||||||||||||||||||
| ).qty_available | ||||||||||||||||||
|
Comment on lines
+414
to
+417
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to avoid double negations ?
Suggested change
What do you think ? |
||||||||||||||||||
| data["scan_location_or_pack_first"] = self.work.menu.scan_location_or_pack_first | ||||||||||||||||||
| data.update(kw) | ||||||||||||||||||
| return data | ||||||||||||||||||
|
|
||||||||||||||||||
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.
why not simply this?
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.
@sbejaoui