本文整理汇总了Python中stoqlib.api.api.for_person_combo函数的典型用法代码示例。如果您正苦于以下问题:Python for_person_combo函数的具体用法?Python for_person_combo怎么用?Python for_person_combo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了for_person_combo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _setup_widgets
def _setup_widgets(self):
branches = Branch.get_active_remote_branches(self.store)
self.destination_branch.prefill(api.for_person_combo(branches))
self.source_branch.set_text(self.branch.get_description())
employees = self.store.find(Employee)
self.source_responsible.prefill(api.for_person_combo(employees))
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:stocktransferwizard.py
示例2: _setup_widgets
def _setup_widgets(self):
branches = Branch.get_active_remote_branches(self.store)
self.destination_branch.prefill(api.for_person_combo(branches))
self.source_branch.set_text(self.branch.get_description())
employees = self.store.find(Employee)
self.source_responsible.prefill(api.for_person_combo(employees))
self.invoice_number.set_property('mandatory', self._nfe_is_active)
# Set an initial invoice number to TransferOrder and Invoice
if not self.model.invoice_number:
new_invoice_number = Invoice.get_next_invoice_number(self.store)
self.model.invoice_number = new_invoice_number
开发者ID:amaurihamasu,项目名称:stoq,代码行数:14,代码来源:stocktransferwizard.py
示例3: _fill_transporter_combo
def _fill_transporter_combo(self):
marker('Filling transporters')
transporters = Transporter.get_active_transporters(self.store)
items = api.for_person_combo(transporters)
self.transporter.prefill(items)
self.transporter.set_sensitive(len(items))
marker('Filled transporters')
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:salewizard.py
示例4: _setup_widgets
def _setup_widgets(self):
quote_group = str(self.wizard.quote_group.identifier)
self.quote_group.set_text(quote_group)
branches = Branch.get_active_branches(self.store)
self.branch_combo.prefill(api.for_person_combo(branches))
self.notes.set_accepts_tab(False)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:7,代码来源:purchasequotewizard.py
示例5: populate
def populate(self, person):
from stoqlib.domain.person import (Client, Supplier, Transporter,
SalesPerson, Branch)
store = get_store_for_field(self)
person_type = self.person_type
if person_type == Supplier:
objects = Supplier.get_active_suppliers(store)
self.add_button.set_tooltip_text(_("Add a new supplier"))
self.edit_button.set_tooltip_text(_("Edit the selected supplier"))
elif person_type == Client:
objects = Client.get_active_clients(store)
self.add_button.set_tooltip_text(_("Add a new client"))
self.edit_button.set_tooltip_text(_("Edit the selected client"))
elif person_type == Transporter:
objects = Transporter.get_active_transporters(store)
self.add_button.set_tooltip_text(_("Add a new transporter"))
self.edit_button.set_tooltip_text(_("Edit the selected transporter"))
elif person_type == SalesPerson:
objects = SalesPerson.get_active_salespersons(store)
self.add_button.set_tooltip_text(_("Add a new sales person"))
self.edit_button.set_tooltip_text(_("Edit the selected sales person"))
elif person_type == Branch:
objects = Branch.get_active_branches(store)
self.add_button.set_tooltip_text(_("Add a new branch"))
self.edit_button.set_tooltip_text(_("Edit the selected branch"))
else:
raise AssertionError(self.person_type)
self.widget.prefill(api.for_person_combo(objects))
if person:
assert isinstance(person, person_type)
self.widget.select(person)
开发者ID:romaia,项目名称:stoq,代码行数:33,代码来源:fields.py
示例6: setup_proxies
def setup_proxies(self):
branches = self.store.find(Branch)
self.branch.prefill(api.for_person_combo(branches))
self.add_proxy(self.model, StationEditor.proxy_widgets)
if not self.edit_mode:
self.is_active.set_sensitive(False)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:stationeditor.py
示例7: _fill_clients_combo
def _fill_clients_combo(self):
# FIXME: This should not be using a normal ProxyComboEntry,
# we need a specialized widget that does the searching
# on demand.
clients = Client.get_active_clients(self.store)
self.client.prefill(api.for_person_combo(clients))
self.client.mandatory = True
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:loanwizard.py
示例8: _setup_widgets
def _setup_widgets(self):
# Salesperson combo
salespersons = SalesPerson.get_active_salespersons(self.store)
self.salesperson.prefill(api.for_person_combo(salespersons))
change_salesperson = sysparam.get_int('ACCEPT_CHANGE_SALESPERSON')
if change_salesperson == ChangeSalespersonPolicy.ALLOW:
self.salesperson.grab_focus()
elif change_salesperson == ChangeSalespersonPolicy.DISALLOW:
self.salesperson.set_sensitive(False)
elif change_salesperson == ChangeSalespersonPolicy.FORCE_CHOOSE:
self.model.salesperson = None
self.salesperson.grab_focus()
else:
raise AssertionError
# CFOP combo
if sysparam.get_bool('ASK_SALES_CFOP'):
cfops = CfopData.get_for_sale(self.store)
self.cfop.prefill(api.for_combo(cfops))
else:
self.cfop_lbl.hide()
self.cfop.hide()
self.create_cfop.hide()
self._fill_clients_category_combo()
self._setup_clients_widget()
self._client_credit_set_visible(bool(self.client.read()))
开发者ID:esosaja,项目名称:stoq,代码行数:29,代码来源:salequotewizard.py
示例9: _setup_widgets
def _setup_widgets(self):
# Hide total and subtotal
self.table1.hide()
self.hbox4.hide()
# Hide invoice number details
self.invoice_number_label.hide()
self.invoice_number.hide()
# Hide cost center combobox
self.cost_center_lbl.hide()
self.cost_center.hide()
# Salesperson combo
salespersons = self.store.find(SalesPerson)
self.salesperson.prefill(api.for_person_combo(salespersons))
if not sysparam(self.store).ACCEPT_CHANGE_SALESPERSON:
self.salesperson.set_sensitive(False)
else:
self.salesperson.grab_focus()
# CFOP combo
if sysparam(self.store).ASK_SALES_CFOP:
cfops = self.store.find(CfopData)
self.cfop.prefill(api.for_combo(cfops))
else:
self.cfop_lbl.hide()
self.cfop.hide()
self.create_cfop.hide()
self.transporter_lbl.hide()
self.transporter.hide()
self.create_transporter.hide()
self._fill_clients_combo()
self._fill_clients_category_combo()
开发者ID:rosalin,项目名称:stoq,代码行数:35,代码来源:salequotewizard.py
示例10: setup_widgets
def setup_widgets(self):
marker('Setting up widgets')
# Only quotes have expire date.
self.expire_date.hide()
self.expire_label.hide()
# Hide client category widgets
self.client_category_lbl.hide()
self.client_category.hide()
# if the NF-e plugin is active, the client is mandantory in this
# wizard (in this situation, we have only quote sales).
if self.model.status == Sale.STATUS_QUOTE:
manager = get_plugin_manager()
mandatory_client = manager.is_active('nfe')
self.client.set_property('mandatory', mandatory_client)
marker('Filling sales persons')
salespersons = self.store.find(SalesPerson)
self.salesperson.prefill(api.for_person_combo(salespersons))
marker('Finished filling sales persons')
marker('Read parameter')
change_salesperson = sysparam.get_int('ACCEPT_CHANGE_SALESPERSON')
if change_salesperson == ChangeSalespersonPolicy.ALLOW:
self.salesperson.grab_focus()
elif change_salesperson == ChangeSalespersonPolicy.DISALLOW:
self.salesperson.set_sensitive(False)
elif change_salesperson == ChangeSalespersonPolicy.FORCE_CHOOSE:
self.model.salesperson = None
self.salesperson.grab_focus()
else:
raise AssertionError
marker('Finished reading parameter')
self._setup_clients_widget()
self._fill_transporter_combo()
self._fill_cost_center_combo()
if sysparam.get_bool('ASK_SALES_CFOP'):
self._fill_cfop_combo()
else:
self.cfop_lbl.hide()
self.cfop.hide()
self.create_cfop.hide()
# the maximum number allowed for an invoice is 999999999.
self.invoice_number.set_adjustment(
gtk.Adjustment(lower=1, upper=999999999, step_incr=1))
if not self.model.invoice_number:
new_invoice_number = Invoice.get_next_invoice_number(self.store)
self.invoice_model.invoice_number = new_invoice_number
else:
new_invoice_number = self.model.invoice_number
self.invoice_model.invoice_number = new_invoice_number
self.invoice_number.set_sensitive(False)
self.invoice_model.original_invoice = new_invoice_number
marker('Finished setting up widgets')
开发者ID:Farrapo,项目名称:stoq,代码行数:59,代码来源:salewizard.py
示例11: _setup_transporter_entry
def _setup_transporter_entry(self):
self.add_transporter.set_tooltip_text(_("Add a new transporter"))
self.edit_transporter.set_tooltip_text(_("Edit the selected transporter"))
items = Transporter.get_active_transporters(self.store)
self.transporter.prefill(api.for_person_combo(items))
self.transporter.set_sensitive(not items.is_empty())
self.edit_transporter.set_sensitive(not items.is_empty())
开发者ID:Guillon88,项目名称:stoq,代码行数:8,代码来源:purchasewizard.py
示例12: _setup_widgets
def _setup_widgets(self):
quote_group = str(self.wizard.quote_group.identifier)
self.quote_group.set_text(quote_group)
branches = Branch.get_active_branches(self.store)
self.branch_combo.prefill(api.for_person_combo(branches))
sync_mode = api.sysparam.get_bool('SYNCHRONIZED_MODE')
self.branch_combo.set_sensitive(not sync_mode)
self.notes.set_accepts_tab(False)
开发者ID:pkaislan,项目名称:stoq,代码行数:10,代码来源:purchasequotewizard.py
示例13: _prefill_branches
def _prefill_branches(self):
branches = Branch.get_active_remote_branches(self.store)
current_branch = api.get_current_branch(self.store)
# Branches not allowed to execute foreign work orders can only send
# orders for those who can
if not current_branch.can_execute_foreign_work_orders:
branches = branches.find(can_execute_foreign_work_orders=True)
self.destination_branch.prefill(api.for_person_combo(branches))
开发者ID:Guillon88,项目名称:stoq,代码行数:10,代码来源:workordereditor.py
示例14: _fill_clients_combo
def _fill_clients_combo(self):
marker('Filling clients')
# FIXME: This should not be using a normal ProxyComboEntry,
# we need a specialized widget that does the searching
# on demand.
clients = Client.get_active_clients(self.store)
self.client.prefill(api.for_person_combo(clients))
self.client.set_sensitive(len(self.client.get_model()))
marker('Filled clients')
开发者ID:romaia,项目名称:stoq,代码行数:10,代码来源:salewizard.py
示例15: _setup_widgets
def _setup_widgets(self):
# Salesperson combo
salespersons = self.store.find(SalesPerson)
self.salesperson.prefill(api.for_person_combo(salespersons))
if sysparam(self.store).ACCEPT_CHANGE_SALESPERSON:
self.salesperson.grab_focus()
else:
self.salesperson.set_sensitive(False)
self._fill_clients_combo()
self._fill_wo_categories_combo()
开发者ID:qman1989,项目名称:stoq,代码行数:11,代码来源:opticalwizard.py
示例16: _setup_widgets
def _setup_widgets(self):
# Hide total and subtotal
self.table1.hide()
self.hbox4.hide()
# Hide invoice number details
self.invoice_number_label.hide()
self.invoice_number.hide()
# Hide cost center combobox
self.cost_center_lbl.hide()
self.cost_center.hide()
# Responsible combo
self.salesperson_lbl.set_text(_(u'Responsible:'))
self.salesperson.model_attribute = 'responsible'
users = self.store.find(LoginUser, is_active=True)
self.salesperson.prefill(api.for_person_combo(users))
self.salesperson.set_sensitive(False)
self._fill_clients_combo()
self._fill_clients_category_combo()
self.expire_date.mandatory = True
# CFOP combo
self.cfop_lbl.hide()
self.cfop.hide()
self.create_cfop.hide()
# Transporter/RemovedBy Combo
self.transporter_lbl.set_text(_(u'Removed By:'))
self.create_transporter.hide()
# removed_by widget
self.removed_by = ProxyEntry(unicode)
self.removed_by.model_attribute = 'removed_by'
if 'removed_by' not in self.proxy_widgets:
self.proxy_widgets.append('removed_by')
self.removed_by.show()
self._replace_widget(self.transporter, self.removed_by)
# Operation Nature widget
self.operation_nature.hide()
self.nature_lbl.hide()
开发者ID:qman1989,项目名称:stoq,代码行数:45,代码来源:loanwizard.py
示例17: _fill_branch_combo
def _fill_branch_combo(self):
branches = Branch.get_active_branches(self.store)
self.branch.prefill(api.for_person_combo(branches))
开发者ID:marianaanselmo,项目名称:stoq,代码行数:3,代码来源:productionwizard.py
示例18: _fill_branch_combo
def _fill_branch_combo(self):
branches = Branch.get_active_branches(self.store)
self.branch.prefill(api.for_person_combo(branches))
self.branch.set_sensitive(api.can_see_all_branches())
开发者ID:Guillon88,项目名称:stoq,代码行数:4,代码来源:purchasewizard.py
示例19: _fill_supplier_combo
def _fill_supplier_combo(self):
suppliers = Supplier.get_active_suppliers(self.store)
self.edit_supplier.set_sensitive(any(suppliers))
self.supplier.prefill(api.for_person_combo(suppliers))
开发者ID:Guillon88,项目名称:stoq,代码行数:4,代码来源:purchasewizard.py
示例20: get_targets
def get_targets(self):
branches = Branch.get_active_branches(self._store)
return api.for_person_combo(branches)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:3,代码来源:userbranchaccessslave.py
注:本文中的stoqlib.api.api.for_person_combo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论