本文整理汇总了Python中stoqlib.domain.returnedsale.ReturnedSale.get_pending_returned_sales方法的典型用法代码示例。如果您正苦于以下问题:Python ReturnedSale.get_pending_returned_sales方法的具体用法?Python ReturnedSale.get_pending_returned_sales怎么用?Python ReturnedSale.get_pending_returned_sales使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.returnedsale.ReturnedSale
的用法示例。
在下文中一共展示了ReturnedSale.get_pending_returned_sales方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_pending_returned_sale_message
# 需要导入模块: from stoqlib.domain.returnedsale import ReturnedSale [as 别名]
# 或者: from stoqlib.domain.returnedsale.ReturnedSale import get_pending_returned_sales [as 别名]
def _create_pending_returned_sale_message(self):
branch = api.get_current_branch(self.store)
n_returned = ReturnedSale.get_pending_returned_sales(self.store, branch).count()
if not n_returned:
return None
msg = stoqlib_ngettext(_(u"You have %s returned sale to receive"),
_(u"You have %s returned sales to receive"),
n_returned) % n_returned
info_returned_bar = self.window.add_info_bar(gtk.MESSAGE_QUESTION, msg)
button = info_returned_bar.add_button(_(u"Returned sale"), gtk.RESPONSE_OK)
button.connect('clicked', self._on_info_returned_sales__clicked)
return info_returned_bar
示例2: _search_pending_returned_sales
# 需要导入模块: from stoqlib.domain.returnedsale import ReturnedSale [as 别名]
# 或者: from stoqlib.domain.returnedsale.ReturnedSale import get_pending_returned_sales [as 别名]
def _search_pending_returned_sales(self):
with api.new_store() as store:
self.run_dialog(PendingReturnedSaleSearch, store)
branch = api.get_current_branch(self.store)
# After the search is closed we may want to update , or even hide the
# message, if there is no pending returned sale to receive
if self.returned_bar:
n_returned = ReturnedSale.get_pending_returned_sales(self.store, branch).count()
if n_returned > 0:
msg = stoqlib_ngettext(_(u"You have %s returned sale to receive"),
_(u"You have %s returned sales to receive"),
n_returned) % n_returned
self.returned_bar.set_message(msg)
else:
self.returned_bar.hide()
self.refresh()