commit 11155244d430e976b2ea4312d9ef9e072f7472a1
parent 29a101cae3fd36806b8c8080639fd343cb2c6e32
Author: Paco Esteban <paco@e1e0.net>
Date: Sun, 14 Mar 2021 12:40:36 +0100
add history event on part add too
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/database.py b/database.py
@@ -111,6 +111,7 @@ class PartsDB():
with self.conn:
c = self.conn.cursor()
c.execute(INSERT_PART_QUERY, p)
+ return c.lastrowid
def get_part(self, part_id):
c = self.conn.cursor()
diff --git a/myChips.py b/myChips.py
@@ -103,7 +103,8 @@ def add_part(mpn, quantity, category, storage, part_type):
image,
part_type
]
- db.new_part(part)
+ new_id = db.new_part(part)
+ db.new_part_history_event(new_id, quantity, "first purchase")
def list_parts(category, short):