本文整理汇总了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;未经允许,请勿转载。 |
请发表评论