From 4962786cbde9c2e4a9bcfb8ebbf36f87a051b4cf Mon Sep 17 00:00:00 2001 From: George Yohng Date: Sun, 21 Apr 2024 21:16:00 +0800 Subject: [PATCH] Fix sorting: update part stock quantity if a mismatch is found, because the cached field is used for sorting directly. --- mainwindow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mainwindow.py b/mainwindow.py index d9328bc..bd6089b 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -621,7 +621,9 @@ def populate_footprint_list(self, *_): ) if detail: part[4] = detail[0][2] - part[5] = detail[0][1] + if part[5] != str(detail[0][1]): + part[5] = str(detail[0][1]) + self.store.set_stock(part[0], detail[0][1]) # First check if the part name mathes for regex, correction in corrections: if re.search(regex, str(part[1])):