本文整理汇总了Python中stoqlib.gui.editors.baseeditor.BaseEditorSlave类的典型用法代码示例。如果您正苦于以下问题:Python BaseEditorSlave类的具体用法?Python BaseEditorSlave怎么用?Python BaseEditorSlave使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseEditorSlave类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, store, employee, edit_mode, visual_mode=False):
self.employee = employee
self.person = employee.person
self.salesperson = self.person.salesperson
self.is_edit_mode = edit_mode
self.current_role_history = self._get_active_role_history()
BaseEditorSlave.__init__(self, store, visual_mode=visual_mode)
示例2: __init__
def __init__(self, wizard, parent, store, order_obj, payment_method,
outstanding_value=currency(0), first_duedate=None,
installments_number=None):
self.wizard = wizard
self.parent = parent
# Note that 'order' may be a Sale or a PurchaseOrder object
self.order = order_obj
self.method = payment_method
self.payment_type = self._get_payment_type()
self.total_value = outstanding_value or self._get_total_amount()
self.payment_group = self.order.group
self.payment_list = None
# This is very useful when calculating the total amount outstanding
# or overpaid of the payments
self.interest_total = currency(0)
self._first_duedate = first_duedate
self._installments_number = installments_number
BaseEditorSlave.__init__(self, store)
self.register_validate_function(self._refresh_next)
# Most of slaves don't have bank information
self.bank_combo.hide()
self.bank_label.hide()
示例3: __init__
def __init__(self, store, model, model_type, visual_mode=False):
self._proxy = None
self.model = model
self.model_type = model_type
self.default_max_discount = sysparam(store).MAX_SALE_DISCOUNT
self.max_discount = self.default_max_discount
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例4: __init__
def __init__(self, store, model, parent):
self.model = model
self.icms_slave = parent.icms_slave
self.ipi_slave = parent.ipi_slave
self.pis_slave = parent.pis_slave
self.cofins_slave = parent.cofins_slave
self.quantity_model = Settable(quantity=model.quantity)
BaseEditorSlave.__init__(self, store, self.model)
示例5: __init__
def __init__(self, store, model, visual_mode=False):
self.purchases = list(model.get_purchase_orders())
# Save the receiving order if there is only one for this receiving invoice
try:
self._receiving_order = model.receiving_orders.one()
except NotOneError:
self._receiving_order = None
BaseEditorSlave.__init__(self, store, model, visual_mode)
示例6: __init__
def __init__(self, store, person, model=None, is_main_address=True,
visual_mode=False, db_form=None):
self.person = person
self.is_main_address = (model and model.is_main_address
or is_main_address)
self.db_form = db_form
if model is not None:
model = store.fetch(model)
model = _AddressModel(model, store)
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例7: __init__
def __init__(self, store, model=None, person_slave=None,
visual_mode=False):
""" Creates a new IndividualEditorTemplate object
:param store: a store
:param model: model
:param person_slave: the person slave
:param visual_model:
"""
self._person_slave = person_slave
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例8: __init__
def __init__(self, store, workorder, show_finish_date=False):
"""
:param workorder: The |workorder| this slave is editing. We will
actually edit another object, but the |workorder| will be used to
fetch or create it.
:param show_finish_date: If the estimated finish date property of the
work order should be editable in this slave.
"""
self._show_finish_date = show_finish_date
self._workorder = workorder
model = self._create_model(store)
BaseEditorSlave.__init__(self, store, model)
示例9: __init__
def __init__(self, store, model, model_type, visual_mode=False):
self._proxy = None
self.model = model
self.model_type = model_type
self.default_max_discount = sysparam.get_decimal('MAX_SALE_DISCOUNT')
self.max_discount = self.default_max_discount
# If there is an original discount, this means the sale was from a trade,
# and the parameter USE_TRADE_AS_DISCOUNT must be set.
self.original_discount = self.model.discount_value * 100 / self.model.get_sale_subtotal()
if self.original_discount:
assert sysparam.get_bool('USE_TRADE_AS_DISCOUNT')
self.original_sale_amount = self.model.get_total_sale_amount()
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例10: __init__
def __init__(self, store, model, sellable=None, visual_mode=False):
self.image_model = model
self._updating_widgets = False
self._sellable = sellable
BaseEditorSlave.__init__(self, store, model, visual_mode)
self._setup_thumbnail()
self._setup_widgets()
self._app_info = Gio.app_info_get_default_for_type('image/png', False)
if not self._app_info:
# Hide view item if we don't have any app to visualize it.
self.view_item.hide()
示例11: __init__
def __init__(self, store, person, model=None, is_main_address=True,
visual_mode=False, db_form=None):
self.person = person
self.is_main_address = (model and model.is_main_address
or is_main_address)
self.db_form = db_form
if model is not None:
model = store.fetch(model)
model = _AddressModel(model, store)
plugin = get_plugin_manager()
self._nfe_active = plugin.is_any_active(['nfe', 'nfce'])
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例12: __init__
def __init__(self, store, model, parent):
self.model = model
self.icms_slave = parent.icms_slave
self.ipi_slave = parent.ipi_slave
# Use a temporary object to edit the quantities, so we can delay the
# database constraint checks
self.quantity_model = Settable(quantity=model.quantity,
reserved=model.quantity_decreased)
self.proxy = None
BaseEditorSlave.__init__(self, store, self.model)
sale = self.model.sale
if sale.status == Sale.STATUS_CONFIRMED:
self._set_not_editable()
示例13: __init__
def __init__(self, store, workorder, show_finish_date=False, visual_mode=False):
"""
:param workorder: The |workorder| this slave is editing. We will
actually edit another object, but the |workorder| will be used to
fetch or create it.
:param show_finish_date: If the estimated finish date property of the
work order should be editable in this slave.
"""
self._show_finish_date = show_finish_date
self._workorder = workorder
model = self._create_model(store)
# This is used to correctly triangulate the values of the spherical
# widgets
self._update_order = {"re": [], "le": []}
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)
示例14: __init__
def __init__(self, store, model, can_change=True, can_erase=True,
visual_mode=False):
self._image_model = model
model = _DummyImageModel()
BaseEditorSlave.__init__(self, store, model, visual_mode)
self._setup_image_model()
self._setup_widgets()
if not can_change:
self.edit_item.hide()
if not can_erase:
self.erase_item.hide()
self._app_info = gio.app_info_get_default_for_type('image/png', False)
if not self._app_info:
# Hide view item if we don't have any app to visualize it.
self.view_item.hide()
示例15: __init__
def __init__(self, store, workorder, show_finish_date=False,
visual_mode=False, description=u"", parent=None):
"""
:param workorder: The |workorder| this slave is editing. We will
actually edit another object, but the |workorder| will be used to
fetch or create it.
:param show_finish_date: If the estimated finish date property of the
work order should be editable in this slave.
"""
self._update_level = 0
self.parent = parent
self._focus_change = False
self._show_finish_date = show_finish_date
self._workorder = workorder
self._description = description
model = self._create_model(store)
# This is used to correctly triangulate the values of the spherical
# widgets
self._update_order = {'re': [], 'le': []}
BaseEditorSlave.__init__(self, store, model, visual_mode=visual_mode)