mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Squashed commit
Fixed some localization strings Reviewed/optimized product deletion handling Add option to hide products from the stock overview page (closes #906) Prefill default_due_days also on the inventory page (closes #591) Added DataTables accent chinese-string plugin (closes #872) Show costs and calories per recipe ingredient (closes #1072) Fixed user permission saving (fixes #1099) User permissions should not have an effect for demo mode (closes #972) Handle QU conversion when consuming a substituation (child) product (fixes #1118) Consume/open any child product when the parent product is not in stock (closes #899) Added a retry camera barcode scanning button to product picker workflow (closes #736)
This commit is contained in:
@@ -70,6 +70,7 @@ CREATE TABLE products (
|
||||
cumulate_min_stock_amount_of_sub_products TINYINT DEFAULT 0,
|
||||
due_type TINYINT NOT NULL DEFAULT 1 CHECK(due_type IN (1, 2)),
|
||||
quick_consume_amount REAL NOT NULL DEFAULT 1,
|
||||
show_on_stock_overview TINYINT NOT NULL DEFAULT 1 CHECK(show_on_stock_overview IN (0, 1)),
|
||||
row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime'))
|
||||
);
|
||||
|
||||
|
@@ -37,7 +37,8 @@ FROM (
|
||||
WHERE m.id NOT IN (SELECT product_id FROM stock_current)
|
||||
) sc
|
||||
LEFT JOIN products p
|
||||
ON sc.product_id = p.id;
|
||||
ON sc.product_id = p.id
|
||||
WHERE p.show_on_stock_overview = 1;
|
||||
|
||||
CREATE VIEW uihelper_stock_current_overview
|
||||
AS
|
||||
@@ -78,4 +79,5 @@ FROM (
|
||||
WHERE m.id NOT IN (SELECT product_id FROM stock_current)
|
||||
) sc
|
||||
LEFT JOIN products p
|
||||
ON sc.product_id = p.id;
|
||||
ON sc.product_id = p.id
|
||||
WHERE p.show_on_stock_overview = 1;
|
||||
|
@@ -128,7 +128,7 @@ SELECT
|
||||
SELECT pc.permission_name
|
||||
FROM user_permissions_resolved pc
|
||||
WHERE pc.user_id = u.id
|
||||
)
|
||||
) AS has_permission,
|
||||
ph.parent AS parent
|
||||
)
|
||||
) AS has_permission,
|
||||
ph.parent AS parent
|
||||
FROM users u, permission_hierarchy ph;
|
||||
|
25
migrations/0120.sql
Normal file
25
migrations/0120.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
CREATE TRIGGER cascade_product_removal AFTER DELETE ON products
|
||||
BEGIN
|
||||
DELETE FROM stock_log
|
||||
WHERE product_id = OLD.id;
|
||||
|
||||
DELETE FROM product_barcodes
|
||||
WHERE product_id = OLD.id;
|
||||
|
||||
DELETE FROM quantity_unit_conversions
|
||||
WHERE product_id = OLD.id;
|
||||
|
||||
DELETE FROM recipes_pos
|
||||
WHERE product_id = OLD.id;
|
||||
|
||||
UPDATE recipes
|
||||
SET product_id = NULL
|
||||
WHERE product_id = OLD.id;
|
||||
|
||||
DELETE FROM meal_plan
|
||||
WHERE product_id = OLD.id
|
||||
AND type = 'product';
|
||||
|
||||
DELETE FROM shopping_list
|
||||
WHERE product_id = OLD.id;
|
||||
END;
|
Reference in New Issue
Block a user