bug fixes and improvements
This commit is contained in:
@@ -15,8 +15,6 @@ class OrderItem < ApplicationRecord
|
||||
|
||||
after_save :update_stock_journal
|
||||
|
||||
# after_update :update_stock_journal
|
||||
|
||||
# after_save :add_to_journal, if: Proc.new { !self.id_changed? }
|
||||
# after_save :update_stock_journal, if: Proc.new { self.id_changed? }
|
||||
|
||||
@@ -127,7 +125,7 @@ class OrderItem < ApplicationRecord
|
||||
end
|
||||
|
||||
def update_stock_journal
|
||||
if self.qty != self.qty_was
|
||||
if self.qty != self.qty_before_last_save
|
||||
found, inventory_definition = InventoryDefinition.find_product_in_inventory(self)
|
||||
if found
|
||||
InventoryDefinition.check_balance(self, inventory_definition)
|
||||
|
||||
Reference in New Issue
Block a user