Better manage price object juggling in Item.price property. The previous way was creating new price objects when an object already existed in the database which could lead to Integrity issues.
This commit is contained in:
@@ -3,6 +3,7 @@ import gui.mainFrame
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
import gui.globalEvents as GE
|
||||
from service.price import Price
|
||||
from service.settings import ContextMenuSettings
|
||||
|
||||
|
||||
@@ -21,6 +22,8 @@ class PriceClear(ContextMenu):
|
||||
return "Reset Price Cache"
|
||||
|
||||
def activate(self, fullContext, selection, i):
|
||||
sPrc = Price.getInstance()
|
||||
sPrc.clearPriceCache()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user