本文整理汇总了Python中stoqlib.gui.base.wizards.BaseWizard类的典型用法代码示例。如果您正苦于以下问题:Python BaseWizard类的具体用法?Python BaseWizard怎么用?Python BaseWizard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseWizard类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, store, model):
self.temporary_items = {}
self.imported_count = {}
self.manual_count = True
first_step = InventoryCountTypeStep(store, self, previous=None)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:amaurihamasu,项目名称:stoq,代码行数:7,代码来源:inventorywizard.py
示例2: __init__
def __init__(self, store, model=None):
model = model or self._create_model(store)
# If we receive the order right after the purchase.
self.receiving_model = None
first_step = StartConsignmentStep(self, store, model)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:consignmentwizard.py
示例3: __init__
def __init__(self, options, config=None):
if not config:
config = StoqConfig()
self.settings = config.get_settings()
self.link_request_done = False
self.create_examples = False
self.config = config
self.enable_production = False
self.has_installed_db = False
self.options = options
self.plugins = []
self.db_is_local = False
self.enable_online_services = True
self.auth_type = TRUST_AUTHENTICATION
if config.get('Database', 'enable_production') == 'True':
self.enable_production = True
if self.enable_production:
first_step = PluginStep(self)
else:
first_step = WelcomeStep(self)
BaseWizard.__init__(self, None, first_step, title=self.title)
self.get_toplevel().set_deletable(False)
self.next_button.grab_focus()
开发者ID:adrianoaguiar,项目名称:stoq,代码行数:27,代码来源:config.py
示例4: __init__
def __init__(self, store):
self.model = None
self.sync_mode = api.sysparam.get_bool('SYNCHRONIZED_MODE')
self.current_branch = api.get_current_branch(store)
first_step = ReceivingSelectionStep(self, store)
BaseWizard.__init__(self, store, first_step, self.model)
self.next_button.set_sensitive(False)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:reconciliationwizard.py
示例5: __init__
def __init__(self, store, model):
self.temporary_items = {}
self.imported_count = {}
self.manual_count = True
self.can_count_twice = api.sysparam.get_bool('ALLOW_SAME_SELLABLE_IN_A_ROW')
first_step = InventoryCountTypeStep(store, self, previous=None)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:hackedbellini,项目名称:stoq,代码行数:8,代码来源:inventorywizard.py
示例6: __init__
def __init__(self, store, role_editor):
if not issubclass(role_editor, BasePersonRoleEditor):
raise TypeError("Editor %s must be BasePersonRoleEditor " "instance" % role_editor)
self.role_editor = role_editor
BaseWizard.__init__(self, store, PersonRoleTypeStep(self, store), title=self.get_role_title())
if role_editor.help_section:
self.set_help_section(role_editor.help_section)
开发者ID:romaia,项目名称:stoq,代码行数:9,代码来源:personwizard.py
示例7: __init__
def __init__(self, store, purchase):
self.purchase = purchase
model = self._create_model(purchase)
if self.purchase.status != PurchaseOrder.ORDER_CONFIRMED:
raise ValueError("Invalid order status. It should " "be ORDER_CONFIRMED")
first_step = PurchaseFinishProductListStep(store, self, model)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:9,代码来源:purchasefinishwizard.py
示例8: __init__
def __init__(self, store, receiving_order=None):
self.receiving_order = receiving_order
if self.receiving_order is not None:
self.title = _('Receiving Order Return')
model = self._create_model(store)
first_step = StartStockDecreaseStep(store, self, model)
BaseWizard.__init__(self, store, first_step, model)
self.create_payments = False
开发者ID:hackedbellini,项目名称:stoq,代码行数:9,代码来源:stockdecreasewizard.py
示例9: __init__
def __init__(self, store, model=None):
title = self._get_title(model)
model = model or self._create_model(store)
if model.status != Sale.STATUS_QUOTE:
raise ValueError('Invalid sale status. It should '
'be STATUS_QUOTE')
first_step = StartSaleQuoteStep(store, self, model)
BaseWizard.__init__(self, store, first_step, model, title=title,
edit_mode=False)
开发者ID:romaia,项目名称:stoq,代码行数:11,代码来源:salequotewizard.py
示例10: __init__
def __init__(self, store, model=None):
title = self._get_title(model)
self.edit = model is not None
self.quote = None
self.quote_group = self._get_or_create_quote_group(model, store)
model = model or self._create_model(store)
if model.status != PurchaseOrder.ORDER_QUOTING:
raise ValueError('Invalid order status. It should '
'be ORDER_QUOTING')
first_step = StartQuoteStep(self, None, store, model)
BaseWizard.__init__(self, store, first_step, model, title=title)
开发者ID:pkaislan,项目名称:stoq,代码行数:12,代码来源:purchasequotewizard.py
示例11: __init__
def __init__(self, store, model=None):
self.unkown_sale = False
if model:
# Adjust items befre creating the step, so that plugins may have a
# chance to change the value
for item in model.returned_items:
_adjust_returned_sale_item(item)
first_step = SaleReturnItemsStep(self, None, store, model)
else:
first_step = SaleReturnSelectionStep(store, self, None)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:12,代码来源:salereturnwizard.py
示例12: __init__
def __init__(self, store, role_editor, document=None):
if not issubclass(role_editor, BasePersonRoleEditor):
raise TypeError('Editor %s must be BasePersonRoleEditor '
'instance' % role_editor)
self.role_editor = role_editor
self._document = document
BaseWizard.__init__(self, store,
self.get_first_step(store),
title=self.get_role_title())
if role_editor.help_section:
self.set_help_section(role_editor.help_section)
开发者ID:amaurihamasu,项目名称:stoq,代码行数:13,代码来源:personwizard.py
示例13: __init__
def __init__(self, store, purchase):
sync_mode = api.sysparam.get_bool("SYNCHRONIZED_MODE")
# When in sync mode, only the branch owner can finish a purchase order.
if sync_mode:
assert purchase.branch == api.get_current_branch(store)
self.purchase = purchase
model = self._create_model(purchase)
if self.purchase.status != PurchaseOrder.ORDER_CONFIRMED:
raise ValueError("Invalid order status. It should " "be ORDER_CONFIRMED")
first_step = PurchaseFinishProductListStep(store, self, model)
BaseWizard.__init__(self, store, first_step, model)
开发者ID:stoq,项目名称:stoq,代码行数:14,代码来源:purchasefinishwizard.py
示例14: __init__
def __init__(self, store, model=None, edit_mode=False):
title = self._get_title(model)
model = model or self._create_model(store)
# Should we show all products or only the ones associated with the
# selected supplier?
self.all_products = False
# If we receive the order right after the purchase.
self.receiving_model = None
if model.status != PurchaseOrder.ORDER_PENDING:
raise ValueError('Invalid order status. It should '
'be ORDER_PENDING')
first_step = StartPurchaseStep(self, store, model)
BaseWizard.__init__(self, store, first_step, model, title=title,
edit_mode=edit_mode)
开发者ID:pkaislan,项目名称:stoq,代码行数:15,代码来源:purchasewizard.py
示例15: test_cancel_confirmation_close
def test_cancel_confirmation_close(self, yesno):
step = _FakeStep(self.store, None)
wizard = BaseWizard(self.store, step, title="Fake")
# need_cancel_confirmation is False, cancel should close the wizard
with mock.patch.object(wizard, 'close') as close:
wizard.cancel()
self.assertEquals(yesno.call_count, 0)
close.assert_called_once()
wizard.need_cancel_confirmation = True
# need_cancel_confirmation is True but there're no changes. Cancel
# should still close the dialog
with mock.patch.object(wizard, 'close') as close:
wizard.cancel()
self.assertEquals(yesno.call_count, 0)
close.assert_called_once()
# Just to make store.get_pending_changes return something greater
# thant the time the wizard was created
self.create_sellable()
yesno.return_value = True
# need_cancel_confirmation is True and there're changes. yesno
# should ask if we can close the wizard or not and since we are
# answering True, it should still close
with mock.patch.object(wizard, 'close') as close:
wizard.cancel()
yesno.assert_called_once_with(
("If you cancel this dialog all changes will be "
"lost. Are you sure?"),
gtk.RESPONSE_NO, "Cancel", "Don't cancel")
close.assert_called_once()
yesno.reset_mock()
yesno.return_value = False
# need_cancel_confirmation is True and there're changes. yesno
# should ask if we can close the wizard or not and since we are
# answering False, it should not close
with mock.patch.object(wizard, 'close') as close:
wizard.cancel()
yesno.assert_called_once_with(
("If you cancel this dialog all changes will be "
"lost. Are you sure?"),
gtk.RESPONSE_NO, "Cancel", "Don't cancel")
self.assertEquals(close.call_count, 0)
开发者ID:barkinet,项目名称:stoq,代码行数:47,代码来源:test_base_wizards.py
示例16: __init__
def __init__(self, store, model, subtotal, total_paid=0,
current_document=None):
"""Creates a new SaleWizard that confirms a sale.
To avoid excessive querying of the database we pass
some data already queried/calculated before hand.
:param store: a store
:param model: a |sale|
:param subtotal: subtotal of the sale
:param total_paid: totaly value already paid
:param current_document: the current document of the identified client,
if any
"""
marker('ConfirmSaleWizard')
self._check_payment_group(model, store)
self._subtotal = subtotal
self._total_paid = total_paid
self._current_document = current_document
self.model = model
# invoice_model is a Settable so avoid bug 4218, where more
# than one checkout may try to use the same invoice number.
self.invoice_model = Settable(invoice_number=None,
original_invoice=None)
adjusted_batches = model.check_and_adjust_batches()
if not adjusted_batches:
first_step = ConfirmSaleBatchStep(store, self, model, None)
else:
marker('running SalesPersonStep')
first_step = SalesPersonStep(self, store, model, self.payment_group,
self.invoice_model)
marker('finished creating SalesPersonStep')
BaseWizard.__init__(self, store, first_step, model)
if not sysparam.get_bool('CONFIRM_SALES_ON_TILL'):
# This was added to allow us to work even if an error
# happened while adding a payment, where we already order
# but cannot confirm and are thrown back to the main
# POS interface
if self.model.can_order():
self.model.order()
marker('leaving ConfirmSaleWizard.__init__')
开发者ID:amaurihamasu,项目名称:stoq,代码行数:45,代码来源:salewizard.py
示例17: __init__
def __init__(self, store, model=None, edit_mode=False):
title = self._get_title(model)
model = model or self._create_model(store)
# Should we show all products or only the ones associated with the
# selected supplier?
self.all_products = False
self.sync_mode = api.sysparam.get_bool('SYNCHRONIZED_MODE')
# If we receive the order right after the purchase.
self.receiving_model = None
purchase_edit = [PurchaseOrder.ORDER_CONFIRMED,
PurchaseOrder.ORDER_PENDING]
if not model.status in purchase_edit:
raise ValueError('Invalid order status. It should '
'be ORDER_PENDING or ORDER_CONFIRMED')
first_step = StartPurchaseStep(self, store, model)
BaseWizard.__init__(self, store, first_step, model, title=title,
edit_mode=edit_mode)
开发者ID:fuinha,项目名称:stoq,代码行数:19,代码来源:purchasewizard.py
示例18: __init__
def __init__(self, options, config=None):
if not config:
config = StoqConfig()
self.settings = config.get_settings()
if is_windows:
self.settings.username = WINDOWS_DEFAULT_USER
self.settings.password = WINDOWS_DEFAULT_PASSWORD
self.settings.dbname = WINDOWS_DEFAULT_DBNAME
self.settings.address = "localhost"
self.settings.port = 5432
self.link_request_done = False
self.create_examples = False
self.config = config
self.enable_production = False
self.has_installed_db = False
self.options = options
self.db_is_local = False
self.enable_online_services = True
self.auth_type = TRUST_AUTHENTICATION
if config.get('Database', 'enable_production') == 'True':
self.enable_production = True
if self.enable_production:
first_step = CreateDatabaseStep(self)
elif is_windows and self.try_connect(self.settings, warn=False):
self.auth_type = PASSWORD_AUTHENTICATION
self.write_pgpass()
first_step = self.connect_for_settings()
else:
first_step = DatabaseLocationStep(self)
BaseWizard.__init__(self, None, first_step, title=self.title)
self.get_toplevel().set_deletable(False)
self.next_button.grab_focus()
开发者ID:hackedbellini,项目名称:stoq,代码行数:38,代码来源:config.py
示例19: __init__
def __init__(self):
first_step = UpdateWelcomeStep(None, wizard=self)
BaseWizard.__init__(self, None, first_step, title=self.title)
# Disable back until #2771 is solved
self.previous_button.hide()
开发者ID:Joaldino,项目名称:stoq,代码行数:5,代码来源:update.py
示例20: __init__
def __init__(self, store):
self.model = None
first_step = PurchaseSelectionStep(self, store)
BaseWizard.__init__(self, store, first_step, self.model)
self.next_button.set_sensitive(False)
开发者ID:barkinet,项目名称:stoq,代码行数:5,代码来源:receivingwizard.py
注:本文中的stoqlib.gui.base.wizards.BaseWizard类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论