Skip to content

Commit

Permalink
Clear line note when stock is disconnected, if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
sde1000 committed Feb 14, 2024
1 parent 3fc9e42 commit 2bd8095
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quicktill/usestock.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def line_chosen(line):
def finish_disconnect(line, sn):
td.s.add(line)
log.info("Use Stock: disconnected item %d from %s", sn, line.name)
if clear_stockline_note_on_new_stock() and line.linetype == "regular":
line.note = ''
item = td.s.query(StockItem).get(sn)
td.s.add(StockAnnotation(stockitem=item, atype="stop",
text=f"{line.name} (Use Stock disconnect)",
Expand All @@ -142,6 +144,8 @@ def finish_disconnect(line, sn):

def finish_reason(line, sn, reason):
td.s.add(line)
if clear_stockline_note_on_new_stock() and line.linetype == "regular":
line.note = ''
stockitem = td.s.query(StockItem).get(sn)
td.s.add(StockAnnotation(
stockitem=stockitem, atype="stop",
Expand Down

0 comments on commit 2bd8095

Please sign in to comment.