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

Python api.get_current_station函数代码示例

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

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



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

示例1: create_model

 def create_model(self, store):
     return DeviceSettings(device_name=None,
                           station=api.get_current_station(store),
                           brand=None,
                           model=None,
                           type=None,
                           store=store)
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:deviceseditor.py


示例2: test_print_invoice

    def test_print_invoice(self, info, print_sale_invoice, run_dialog, new_store):
        new_store.return_value = self.store

        app = self.create_app(SalesApp, u"sales")
        results = app.main_window.results
        results.select(results[0])

        self.activate(app.main_window.SalesPrintInvoice)
        info.assert_called_once_with(u"There are no invoice printer configured " u"for this station")

        layout = InvoiceLayout(description=u"layout", width=10, height=20, store=self.store)
        printer = InvoicePrinter(
            store=self.store,
            description=u"test invoice",
            layout=layout,
            device_name=u"/dev/lp0",
            station=api.get_current_station(self.store),
        )
        self.activate(app.main_window.SalesPrintInvoice)
        self.assertEquals(print_sale_invoice.call_count, 1)
        args, kwargs = print_sale_invoice.call_args
        invoice, called_printer = args
        self.assertTrue(isinstance(invoice, SaleInvoice))
        self.assertEquals(printer, called_printer)

        results[0].sale.invoice_number = None
        InvoiceField(layout=layout, x=0, y=0, width=1, height=1, field_name=u"INVOICE_NUMBER", store=self.store)
        with mock.patch.object(self.store, "commit"):
            with mock.patch.object(self.store, "close"):
                self.activate(app.main_window.SalesPrintInvoice)
                run_dialog.assert_called_once_with(SaleInvoicePrinterDialog, self.store, results[0].sale, printer)
开发者ID:romaia,项目名称:stoq,代码行数:31,代码来源:test_sales.py


示例3: _open_till

    def _open_till(self, store):
        till = Till(store=store, station=api.get_current_station(store))
        till.open_till()

        TillOpenEvent.emit(till=till)
        self.assertEquals(till, Till.get_current(store))
        return till
开发者ID:pkaislan,项目名称:stoq,代码行数:7,代码来源:test_pos.py


示例4: _create_statusbar

    def _create_statusbar(self):
        statusbar = ShellStatusbar(self)

        # Set the initial text, the currently logged in user and the actual
        # branch and station.
        user = api.get_current_user(self.store)
        station = api.get_current_station(self.store)
        status_str = "   |   ".join([_("User: %s") % (user.get_description(),), _("Computer: %s") % (station.name,)])
        statusbar.push(0, status_str)
        return statusbar
开发者ID:rosalin,项目名称:stoq,代码行数:10,代码来源:shellwindow.py


示例5: populate_namespace

    def populate_namespace(self, bare):
        for table in get_table_types():
            self.ns[table.__name__] = table

        self.ns["store"] = self.store
        self.ns["sysparam"] = api.sysparam
        self.ns["api"] = api

        if not bare:
            self.ns["branch"] = api.get_current_branch(self.store)
            self.ns["station"] = api.get_current_station(self.store)
            self.ns["now"] = datetime.datetime.now
            self.ns["today"] = datetime.date.today

            for name in ("stoqlib.database.runtime", "stoqlib.lib.interfaces", "stoqlib.domain.interfaces"):
                mod = __import__(name, {}, {}, " ")
                self.ns.update(mod.__dict__)
开发者ID:romaia,项目名称:stoq,代码行数:17,代码来源:console.py


示例6: populate_namespace

    def populate_namespace(self, bare):
        for table in get_table_types():
            self.ns[table.__name__] = table

        self.ns['store'] = self.store
        self.ns['sysparam'] = api.sysparam
        self.ns['api'] = api

        if not bare:
            self.ns['branch'] = api.get_current_branch(self.store)
            self.ns['station'] = api.get_current_station(self.store)
            self.ns['now'] = datetime.datetime.now
            self.ns['today'] = datetime.date.today

            for name in ('stoqlib.database.runtime',
                         'stoqlib.lib.interfaces',
                         'stoqlib.domain.interfaces'):
                mod = __import__(name, {}, {}, ' ')
                self.ns.update(mod.__dict__)
开发者ID:hackedbellini,项目名称:stoq,代码行数:19,代码来源:console.py


示例7: process_one

    def process_one(self, data, fields, store):
        if data.parent_account:
            name = _(data.parent_account)
            parent = store.find(Account, description=name).one()
        else:
            parent = None
        account = Account(description=data.description,
                          parent=parent,
                          code=None,
                          station=api.get_current_station(store),
                          account_type=int(data.account_type),
                          store=store)

        if data.bank_number:
            BankAccount(account=account,
                        bank_account=data.bank_account,
                        bank_number=int(data.bank_number),
                        bank_branch=data.bank_branch,
                        store=store)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:19,代码来源:accountimporter.py


示例8: _print_invoice

    def _print_invoice(self):
        sale_view = self.results.get_selected()
        assert sale_view
        sale = sale_view.sale
        station = api.get_current_station(self.store)
        printer = InvoicePrinter.get_by_station(station, self.store)
        if printer is None:
            info(_("There are no invoice printer configured for this station"))
            return
        assert printer.layout

        invoice = SaleInvoice(sale, printer.layout)
        if not invoice.has_invoice_number() or sale.invoice.invoice_number:
            print_sale_invoice(invoice, printer)
        else:
            store = api.new_store()
            retval = self.run_dialog(SaleInvoicePrinterDialog, store, store.fetch(sale), printer)
            store.confirm(retval)
            store.close()
开发者ID:stoq,项目名称:stoq,代码行数:19,代码来源:sales.py


示例9: create_model

    def create_model(self, store):
        till = Till(store=store, station=api.get_current_station(store))
        till.open_till()

        return _TillOpeningModel(till=till, value=currency(0))
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:5,代码来源:tilleditor.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python api.get_current_user函数代码示例发布时间:2022-05-27
下一篇:
Python api.get_current_branch函数代码示例发布时间: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