本文整理汇总了Python中stoqlib.gui.wizards.abstractwizard.SellableItemStep.sellable_selected方法的典型用法代码示例。如果您正苦于以下问题:Python SellableItemStep.sellable_selected方法的具体用法?Python SellableItemStep.sellable_selected怎么用?Python SellableItemStep.sellable_selected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.gui.wizards.abstractwizard.SellableItemStep
的用法示例。
在下文中一共展示了SellableItemStep.sellable_selected方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable, batch=None):
SellableItemStep.sellable_selected(self, sellable, batch=batch)
if sellable:
price = sellable.get_price_for_category(
self.model.client_category)
self.cost.set_text("%s" % price)
self.proxy.update('cost')
示例2: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable, batch=None):
# We may receive a batch if the user typed a batch number instead of a
# product code, but we pass batch=None here since the user must select
# the batch when confirming a sale.
SellableItemStep.sellable_selected(self, sellable, batch=None)
if sellable:
price = sellable.get_price_for_category(
self.model.client_category)
self.cost.update(price)
示例3: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable):
SellableItemStep.sellable_selected(self, sellable)
if sellable is None:
return
storable = sellable.product_storable
# FIXME: We should not have to override this method. This should
# be done automatically on SellableItemStep
self.stock_quantity.set_label(
"%s" % storable.get_balance_for_branch(branch=self.model.branch))
示例4: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable):
SellableItemStep.sellable_selected(self, sellable)
if sellable is None:
return
storable = sellable.product_storable
stock_item = storable.get_stock_item(self.branch)
self.stock_quantity.set_label("%s" % stock_item.quantity or 0)
quantity = self._get_stock_balance(sellable)
has_quantity = quantity > 0
self.quantity.set_sensitive(has_quantity)
self.add_sellable_button.set_sensitive(has_quantity)
if has_quantity:
self.quantity.set_range(1, quantity)
示例5: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable, batch=None):
SellableItemStep.sellable_selected(self, sellable, batch=batch)
if sellable:
self.cost.update(sellable.price)
示例6: sellable_selected
# 需要导入模块: from stoqlib.gui.wizards.abstractwizard import SellableItemStep [as 别名]
# 或者: from stoqlib.gui.wizards.abstractwizard.SellableItemStep import sellable_selected [as 别名]
def sellable_selected(self, sellable):
SellableItemStep.sellable_selected(self, sellable)
if sellable:
self.cost.update(sellable.price)