Fixed handling of edited stock entries when calculating a product's average price (references #2292)

This commit is contained in:
Bernd Bestel
2023-08-06 14:05:35 +02:00
parent 1d7f7b2992
commit ee4a082c74
2 changed files with 49 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ FROM products_last_purchased;
CREATE TRIGGER stock_log_INS AFTER INSERT ON stock_log
BEGIN
-- Update products_average_price cache
INSERT OR REPLACE INTO cache__products_average_price
(product_id, price)
SELECT product_id, price