Skip to content

Commit

Permalink
[FIX] stock_barcodes: Keep values don't work after force refresh chan…
Browse files Browse the repository at this point in the history
…ges.

TT50421
  • Loading branch information
carlosdauden committed Aug 5, 2024
1 parent 44dd8c2 commit 7b07820
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stock_barcodes/wizard/stock_barcodes_read_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,14 @@ def action_done(self):
if not self.keep_screen_values or self.todo_line_id.state != "pending":
if not self.env.context.get("skip_clean_values", False):
self.action_clean_values()
keep_vals = {}
else:
keep_vals = self._convert_to_write(self._cache)

Check warning on line 277 in stock_barcodes/wizard/stock_barcodes_read_picking.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_picking.py#L277

Added line #L277 was not covered by tests
self.fill_todo_records()
self.determine_todo_action()
self.action_show_step()
if keep_vals:
self.update_keep_values(keep_vals)

Check warning on line 282 in stock_barcodes/wizard/stock_barcodes_read_picking.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_picking.py#L282

Added line #L282 was not covered by tests
# Force refresh candidate pickings to show green if not pending moves
if not self.pending_move_ids:
self._set_candidate_pickings(self.picking_id)
Expand All @@ -287,6 +292,13 @@ def action_done(self):
self._add_read_log()
return res

def update_keep_values(self, keep_vals):
options = self.option_group_id.option_ids

Check warning on line 296 in stock_barcodes/wizard/stock_barcodes_read_picking.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_picking.py#L296

Added line #L296 was not covered by tests
fields_to_keep = options.filtered(lambda op: not op.clean_after_done).mapped(
"field_name"
)
self.update({f_name: keep_vals[f_name] for f_name in fields_to_keep})

def action_manual_entry(self):
result = super().action_manual_entry()
if result:
Expand Down

0 comments on commit 7b07820

Please sign in to comment.