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:
blitzmann
2017-04-10 20:48:58 -04:00
parent 1260900668
commit ce01c66b3e
3 changed files with 23 additions and 30 deletions

View File

@@ -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()))