mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Only cascade changes of stock QU to recipe ingredients which uses the same QU (references #177)
This commit is contained in:
parent
74f9470769
commit
1b19940aba
@ -102,3 +102,12 @@ JOIN quantity_units qu_from
|
|||||||
ON quc.from_qu_id = qu_from.id
|
ON quc.from_qu_id = qu_from.id
|
||||||
JOIN quantity_units qu_to
|
JOIN quantity_units qu_to
|
||||||
ON quc.to_qu_id = qu_to.id;
|
ON quc.to_qu_id = qu_to.id;
|
||||||
|
|
||||||
|
DROP TRIGGER cascade_change_qu_id_stock;
|
||||||
|
CREATE TRIGGER cascade_change_qu_id_stock AFTER UPDATE ON products
|
||||||
|
BEGIN
|
||||||
|
UPDATE recipes_pos
|
||||||
|
SET qu_id = NEW.qu_id_stock
|
||||||
|
WHERE product_id = NEW.id
|
||||||
|
AND qu_id = OLD.qu_id_stock;
|
||||||
|
END;
|
||||||
|
@ -52,7 +52,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
|||||||
function(productDetails)
|
function(productDetails)
|
||||||
{
|
{
|
||||||
Grocy.RecipePosFormProductChangeCount++;
|
Grocy.RecipePosFormProductChangeCount++;
|
||||||
console.log(Grocy.RecipePosFormProductChangeCount);
|
|
||||||
if (Grocy.RecipePosFormProductChangeCount < 3) // This triggers twice on inital page load, however
|
if (Grocy.RecipePosFormProductChangeCount < 3) // This triggers twice on inital page load, however
|
||||||
{
|
{
|
||||||
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id, true);
|
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user