• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python dialogs.run_dialog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: finish

    def finish(self):
        missing = get_missing_items(self.model, self.store)
        if missing:
            # We want to close the checkout, so the user will be back to the
            # list of items in the sale.
            self.close()
            run_dialog(MissingItemsDialog, self, self.model, missing)
            return False

        self.retval = True
        invoice_number = self.invoice_model.invoice_number

        # Workaround for bug 4218: If the invoice is was already used by
        # another store (another cashier), try using the next one
        # available, or show a warning if the number was manually set.
        while True:
            try:
                self.store.savepoint('before_set_invoice_number')
                self.model.invoice_number = invoice_number
                # We need to flush the database here, or a possible collision
                # of invoice_number will only be detected later on, when the
                # execution flow is not in the try-except anymore.
                self.store.flush()
            except IntegrityError:
                self.store.rollback_to_savepoint('before_set_invoice_number')
                if self._invoice_changed():
                    warning(_(u"The invoice number %s is already used. "
                              "Confirm the sale again to chose another one.") %
                            invoice_number)
                    self.retval = False
                    break
                else:
                    invoice_number += 1
            else:
                break

        self.close()

        group = self.model.group
        # FIXME: This is set too late on Sale.confirm(). If PaymentGroup don't
        #        have a payer, we won't be able to print bills/booklets.
        group.payer = self.model.client and self.model.client.person

        # Commit before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        ConfirmSaleWizardFinishEvent.emit(self.model)

        booklets = list(group.get_payments_by_method_name(u'store_credit'))
        bills = list(group.get_payments_by_method_name(u'bill'))

        if (booklets and
            yesno(_("Do you want to print the booklets for this sale?"),
                  gtk.RESPONSE_YES, _("Print booklets"), _("Don't print"))):
            print_report(BookletReport, booklets)

        if (bills and BillReport.check_printable(bills) and
            yesno(_("Do you want to print the bills for this sale?"),
                  gtk.RESPONSE_YES, _("Print bills"), _("Don't print"))):
            print_report(BillReport, bills)
开发者ID:pkaislan,项目名称:stoq,代码行数:59,代码来源:salewizard.py


示例17: test_price_editor

def test_price_editor():  # pragma nocover
    from decimal import Decimal
    ec = api.prepare_test()
    sellable = ec.create_sellable()
    sellable.cost = Decimal('15.55')
    sellable.price = Decimal('21.50')
    run_dialog(SellablePriceEditor,
               parent=None, store=ec.store, model=sellable)
开发者ID:igorferreira,项目名称:stoq,代码行数:8,代码来源:sellableeditor.py


示例18: new_sale

    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,代码行数:8,代码来源:widgets.py


示例19: _show_client_calls_by_date

    def _show_client_calls_by_date(self, date):
        from stoqlib.gui.search.callsearch import ClientCallsSearch

        store = api.new_store()
        y, m, d = map(int, date.split('-'))
        date = localdate(y, m, d).date()
        run_dialog(ClientCallsSearch, self.app, store, date=date)
        store.close()
开发者ID:leandrorchaves,项目名称:stoq,代码行数:8,代码来源:webview.py


示例20: _run_editor

 def _run_editor(self, button, editor_class):
     with api.trans() as store:
         run_dialog(editor_class, self, store)
     if store.committed:
         self.search.refresh()
         self.results.unselect_all()
         if len(self.results):
             self.results.select(self.results[-1])
开发者ID:leandrorchaves,项目名称:stoq,代码行数:8,代码来源:tillhistory.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python dialogs.BasicDialog类代码示例发布时间:2022-05-27
下一篇:
Python workorder.WorkOrderItem类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap