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


Python dialogs.run_dialog函数代码示例

本文整理汇总了Python中stoqlib.gui.base.dialogs.run_dialog函数的典型用法代码示例。如果您正苦于以下问题:Python run_dialog函数的具体用法?Python run_dialog怎么用?Python run_dialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了run_dialog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _show_client_birthdays_by_date

    def _show_client_birthdays_by_date(self, date):
        from stoqlib.gui.search.personsearch import ClientSearch

        with api.new_store() as store:
            y, m, d = map(int, date.split('-'))
            date = localdate(y, m, d).date()
            run_dialog(ClientSearch, self.app, store, birth_date=date)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:webview.py

示例2: _dialog_client

    def _dialog_client(self, id):
        from stoqlib.domain.person import Client
        from stoqlib.gui.dialogs.clientdetails import ClientDetailsDialog

        with api.new_store() as store:
            model = store.get(Client, id)
            run_dialog(ClientDetailsDialog, self.app, store, model)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:webview.py

示例3: _show_details

 def _show_details(self, model):
     from stoqlib.gui.editors.workordereditor import WorkOrderPackageItemEditor
     parent = self.get_toplevel().get_toplevel()
     # XXX: The window here is not decorated on gnome-shell, and because of
     # the visual_mode it gets no buttons. What to do?
     run_dialog(WorkOrderPackageItemEditor, parent, self.store,
                model=model.package_item, visual_mode=True)
开发者ID:marianaanselmo,项目名称:stoq,代码行数:7,代码来源:workorderslave.py

示例4: finish

    def finish(self):
        missing = get_missing_items(self.model, self.store)
        if missing:
            run_dialog(MissingItemsDialog, self, self.model, missing)
            return False

        order = TransferOrder(
            open_date=self.model.open_date,
            receival_date=self.model.receival_date,
            source_branch=self.model.source_branch,
            destination_branch=self.model.destination_branch,
            source_responsible=self.model.source_responsible,
            destination_responsible=self.model.destination_responsible,
            store=self.store)
        for item in self.model.get_items():
            transfer_item = order.add_sellable(item.sellable,
                                               quantity=item.quantity,
                                               batch=item.batch)
            transfer_item.send()

        # XXX Waiting for transfer order receiving wizard implementation
        order.receive()

        self.retval = self.model
        self.close()
        StockTransferWizardFinishEvent.emit(order)
        self._receipt_dialog(order)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:27,代码来源:stocktransferwizard.py

示例5: on_credit_transactions_button__clicked

 def on_credit_transactions_button__clicked(self, button):
     # If we are not in edit mode, we are creating a new object, and thus we
     # should reuse the transaction
     reuse_store = not self.edit_mode
     run_dialog(CreditInfoListDialog, self.get_toplevel().get_toplevel(),
                self.store, self.model, reuse_store=reuse_store)
     self.proxy.update('credit_account_balance')
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:clientslave.py

示例6: _pay

    def _pay(self, payable_views):
        """
        Pay a list of items from a payable_views, note that
        the list of payable_views must reference the same order
        @param payables_views: a list of payable_views
        """
        assert self._can_pay(payable_views)

        # Do not allow confirming the payment if the purchase was not
        # completely received.
        purchase_order = payable_views[0].purchase

        if (purchase_order and
            api.sysparam.get_bool('BLOCK_INCOMPLETE_PURCHASE_PAYMENTS') and
            not purchase_order.status == PurchaseOrder.ORDER_CLOSED):

            return warning(_("Can't confirm the payment if the purchase "
                             "is not completely received yet."))

        with api.new_store() as store:
            payments = [store.fetch(view.payment) for view in payable_views]

            run_dialog(PurchasePaymentConfirmSlave, self, store,
                       payments=payments)

        if store.committed:
            # We need to refresh the whole list as the payment(s) can possibly
            # disappear for the selected view
            self.refresh()

        self._update_widgets()
开发者ID:barkinet,项目名称:stoq,代码行数:31,代码来源:payable.py

示例7: test_dialog

def test_dialog():  # pragma nocover
    from stoqlib.gui.base.dialogs import run_dialog

    ec = api.prepare_test()
    client = ec.store.find(Client).any()
    run_dialog(OpticalPatientDetails, None, ec.store, client)
    ec.store.commit()
开发者ID:Joaldino,项目名称:stoq,代码行数:7,代码来源:opticalhistory.py

示例8: _edit

    def _edit(self, payable_views):
        with api.new_store() as store:
            order = store.fetch(payable_views[0].purchase)
            run_dialog(PurchasePaymentsEditor, self, store, order)

        if store.committed:
            self.refresh()
开发者ID:barkinet,项目名称:stoq,代码行数:7,代码来源:payable.py

示例9: on_details_button__clicked

 def on_details_button__clicked(self, *args):
     selected = self.search.results.get_selected_rows()[0]
     if not selected:
         raise ValueError('You should have one order selected '
                          'at this point, got nothing')
     run_dialog(PurchaseDetailsDialog, self.wizard, self.store,
                model=selected.purchase)
开发者ID:barkinet,项目名称:stoq,代码行数:7,代码来源:receivingwizard.py

示例10: on_details_button_clicked

 def on_details_button_clicked(self, *args):
     # FIXME: Person editor/slaves are depending on the store being a
     # StoqlibStore. See bug 5012
     with api.trans() as store:
         selected = self.results.get_selected()
         user = store.fetch(selected.user)
         run_dialog(UserEditor, self, store, user, visual_mode=True)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:7,代码来源:personsearch.py

示例11: run_wizard

    def run_wizard(cls, parent):
        """Run the wizard to create a product

        This will run the wizard and after finishing, ask if the user
        wants to create another product alike. The product will be
        cloned and `stoqlib.gui.editors.producteditor.ProductEditor`
        will run as long as the user chooses to create one alike
        """
        with api.new_store() as store:
            rv = run_dialog(cls, parent, store)

        if rv:
            inner_rv = rv

            while yesno(_("Would you like to register another product alike?"),
                        gtk.RESPONSE_NO, _("Yes"), _("No")):
                with api.new_store() as store:
                    template = store.fetch(rv)
                    inner_rv = run_dialog(ProductEditor, parent, store,
                                          product_type=template.product_type,
                                          template=template)

                if not inner_rv:
                    break

        # We are insterested in the first rv that means that at least one
        # obj was created.
        return rv
开发者ID:Guillon88,项目名称:stoq,代码行数:28,代码来源:productwizard.py

示例12: on_details_button_clicked

    def on_details_button_clicked(self, button):
        work_order_view = self.results.get_selected()
        if not work_order_view:
            return

        run_dialog(WorkOrderEditor, self, self.store,
                   model=work_order_view.work_order, visual_mode=True)
开发者ID:Guillon88,项目名称:stoq,代码行数:7,代码来源:workordersearch.py

示例13: run_person_role_dialog

def run_person_role_dialog(role_editor, parent, store, model=None,
                           **editor_kwargs):
    if not model:
        editor_kwargs.pop('visual_mode', None)
        return run_dialog(PersonRoleWizard, parent, store, role_editor,
                          **editor_kwargs)
    return run_dialog(role_editor, parent, store, model, **editor_kwargs)
开发者ID:Joaldino,项目名称:stoq,代码行数:7,代码来源:personwizard.py

示例14: test

def test():  # pragma: no cover
    from stoqlib.gui.base.dialogs import run_dialog

    from stoqlib.api import api
    ec = api.prepare_test()
    model = ec.store.find(CostCenter).any()
    run_dialog(CostCenterDialog, None, ec.store, model)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:costcenterdialog.py

示例15: search_products

 def search_products(self):
     with api.new_store() as store:
         profile = api.get_current_user(store).profile
         can_create = (profile.check_app_permission('admin') or
                       profile.check_app_permission('purchase'))
         run_dialog(ProductSearch, None, store, hide_footer=True, hide_toolbar=not can_create,
                    hide_cost_column=not can_create)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:widgets.py


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