当前位置: 首页>>代码示例>>Python>>正文


Python ReturnedSale.get_pending_returned_sales方法代码示例

本文整理汇总了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
开发者ID:adrianoaguiar,项目名称:stoq,代码行数:17,代码来源:stock.py

示例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()
开发者ID:adrianoaguiar,项目名称:stoq,代码行数:20,代码来源:stock.py


注:本文中的stoqlib.domain.returnedsale.ReturnedSale.get_pending_returned_sales方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。