當前位置: 首頁>>代碼示例>>Python>>正文


Python Inventory.has_open方法代碼示例

本文整理匯總了Python中stoqlib.domain.inventory.Inventory.has_open方法的典型用法代碼示例。如果您正苦於以下問題:Python Inventory.has_open方法的具體用法?Python Inventory.has_open怎麽用?Python Inventory.has_open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stoqlib.domain.inventory.Inventory的用法示例。


在下文中一共展示了Inventory.has_open方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _update_view

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def _update_view(self):
        self.proxy.update("status_str")

        has_open_inventory = bool(Inventory.has_open(self.store, api.get_current_branch(self.store)))

        tab = self._get_tab("execution_holder")
        # If it's not opened, it's at least approved.
        # So, we can enable the execution slave
        tab.set_sensitive(
            self.model.status == WorkOrder.STATUS_WORK_IN_PROGRESS and not has_open_inventory and not self.visual_mode
        )

        has_items = bool(self.model.order_items.count())
        if self.model.can_approve():
            label = _("Approve")
        elif self.model.can_work() and not has_items:
            label = _("Start")
        elif self.model.can_work():
            label = _("Continue")
        elif self.model.can_pause():
            label = _("Pause")
        else:
            label = ""
        self.toggle_status_btn.set_label(label)
        self.toggle_status_btn.set_sensitive(not self.visual_mode and self.model.client is not None)
        self.toggle_status_btn.set_visible(bool(label))

        stock_id, tooltip = get_workorder_state_icon(self.model)
        if stock_id is not None:
            self.state_icon.set_from_stock(stock_id, gtk.ICON_SIZE_MENU)
            self.state_icon.set_visible(True)
            self.state_icon.set_tooltip_text(tooltip)
        else:
            self.state_icon.hide()
開發者ID:pkaislan,項目名稱:stoq,代碼行數:36,代碼來源:workordereditor.py

示例2: _can_open

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def _can_open(self):
        branch = api.get_current_branch(self.store)
        if Inventory.has_open(self.store, branch):
            return False

        # It doesn't make sense to open an inventory if we don't have any stock
        return self.store.find(ProductStockItem, branch=branch).count() > 0
開發者ID:rosalin,項目名稱:stoq,代碼行數:9,代碼來源:inventory.py

示例3: new_sale

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def new_sale(self):
        store = self.window.store
        if Inventory.has_open(store, api.get_current_branch(store)):
            warning(_("You cannot create a quote with an open inventory."))
            return

        with api.new_store() as store:
            run_dialog(SaleQuoteWizard, None, store)
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:10,代碼來源:widgets.py

示例4: setup_proxies

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def setup_proxies(self):
        # Avoid changing widget states in __init__, so that plugins have a
        # chance to override the default settings
        has_open_inventory = Inventory.has_open(self.store,
                                                api.get_current_branch(self.store))
        self.receive_now.set_sensitive(not bool(has_open_inventory))

        self._setup_transporter_entry()
        self.proxy = self.add_proxy(self.model, self.proxy_widgets)
開發者ID:pkaislan,項目名稱:stoq,代碼行數:11,代碼來源:purchasewizard.py

示例5: _setup_widgets

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def _setup_widgets(self):
        self.edit_button.set_sensitive(False)
        if not self.visual_mode:
            self.start_production_check.hide()

        has_open_inventory = Inventory.has_open(self.store,
                                                get_current_branch(self.store))
        self.start_production_check.set_sensitive(not bool(has_open_inventory))

        self.materials.set_columns(self._get_columns())
        for production_item in self.model.get_items():
            self._add_materials(production_item)
開發者ID:marianaanselmo,項目名稱:stoq,代碼行數:14,代碼來源:productionslave.py

示例6: new_sale_with_wo

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def new_sale_with_wo(self):
        store = self.window.store
        if Inventory.has_open(store, api.get_current_branch(store)):
            warning(_("You cannot create a quote with an open inventory."))
            return

        with api.new_store() as store:
            run_dialog(WorkOrderQuoteWizard, None, store)

        if store.committed:
            # We are unable to just refresh the ui, so 'deactivate' and
            # 'activate' the launcher to mimic the refresh
            self.window.switch_application('launcher')
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:15,代碼來源:widgets.py

示例7: _get_available_branches_to_inventory

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
    def _get_available_branches_to_inventory(self):
        """Returns a list of branches where we can open an inventory.
        Note that we can open a inventory if:
            - There's no inventory opened yet (in the same branch)
            - The branch must have some stock
        """
        available_branches = []
        for branch in self._get_branches():
            has_open_inventory = Inventory.has_open(self.store, branch)
            if not has_open_inventory:
                stock = self.store.find(ProductStockItem, branch=branch)
                if stock.count() > 0:
                    available_branches.append(branch)

        return available_branches
開發者ID:marianaanselmo,項目名稱:stoq,代碼行數:17,代碼來源:inventory.py

示例8: has_open_inventory

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
 def has_open_inventory(self):
     has_open = Inventory.has_open(self.store,
                                   api.get_current_branch(self.store))
     return bool(has_open)
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:6,代碼來源:productiondetails.py

示例9: _has_open_inventory

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
 def _has_open_inventory(self):
     store = self._parent.store
     has_open = Inventory.has_open(store, api.get_current_branch(store))
     return bool(has_open)
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:6,代碼來源:clientdetails.py

示例10: has_open_inventory

# 需要導入模塊: from stoqlib.domain.inventory import Inventory [as 別名]
# 或者: from stoqlib.domain.inventory.Inventory import has_open [as 別名]
 def has_open_inventory(self):
     return Inventory.has_open(self.store,
                               api.get_current_branch(self.store))
開發者ID:EasyDevSolutions,項目名稱:stoq,代碼行數:5,代碼來源:shellapp.py


注:本文中的stoqlib.domain.inventory.Inventory.has_open方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。