コード例 #1
0
ファイル: ERP5Type.py プロジェクト: ryan2858/erp5
 def __init__(self, id, **kw):
     XMLObject.__init__(self, id)
     if 'meta_type' in kw:
         kw.setdefault('content_meta_type', kw.pop('meta_type'))
     if 'icon' in kw:
         kw.setdefault('content_icon', kw.pop('icon'))
     self.__dict__.update(kw)
コード例 #2
0
ファイル: Capacity.py プロジェクト: Verde1705/erp5
 def reindexObject(self):
   """
     Overload reindexing in order to forward any modifications of capacity
     to simulation tool
   """
   self.getParentValue().updateCapacity()
   XMLObject.reindexObject(self)
コード例 #3
0
ファイル: ERP5Type.py プロジェクト: ccwalkerjm/erp5
 def __init__(self, id, **kw):
   XMLObject.__init__(self, id)
   if 'meta_type' in kw:
     kw.setdefault('content_meta_type', kw.pop('meta_type'))
   if 'icon' in kw:
     kw.setdefault('content_icon', kw.pop('icon'))
   self.__dict__.update(kw)
コード例 #4
0
ファイル: PythonScript.py プロジェクト: Verde1705/erp5
 def __init__(self, *args, **kw):
   """
   override to call __init__ of python scripts in order to set
   correctly bindings
   """
   XMLObject.__init__(self, *args, **kw)
   ZopePythonScript.__init__(self, *args, **kw)
コード例 #5
0
 def __init__(self, *args, **kw):
     """
   override to call __init__ of python scripts in order to set
   correctly bindings
   """
     XMLObject.__init__(self, *args, **kw)
     ZopePythonScript.__init__(self, *args, **kw)
コード例 #6
0
ファイル: Capacity.py プロジェクト: poses/erp5
 def reindexObject(self):
     """
     Overload reindexing in order to forward any modifications of capacity
     to simulation tool
   """
     self.getParentValue().updateCapacity()
     XMLObject.reindexObject(self)
コード例 #7
0
ファイル: ERP5Type.py プロジェクト: Provab-Solutions/erp5
 def __init__(self, id, **kw):
     XMLObject.__init__(self, id)
     if "meta_type" in kw:
         kw.setdefault("content_meta_type", kw.pop("meta_type"))
     if "icon" in kw:
         kw.setdefault("content_icon", kw.pop("icon"))
     self.__dict__.update(kw)
コード例 #8
0
    def _edit(self, **kw):
        """
    'manange_edit' function for ZSQLMethod needs to be called everytime after
    editing SQLMethod object. This would insure the update of _arg and
    template attribute for SQLMethod which are used while creating query.

    https://github.com/zopefoundation/Products.ZSQLMethods/blob/master/src/Shared/DC/ZRDB/DA.py#L353
    """
        XMLObject._edit(self, **kw)
        src = self.getSrc()
        title = self.title
        if title is None:
            title = ''
        connection_id = self.getConnectionId()
        self.manage_edit(title, connection_id, self.arguments_src, src)
コード例 #9
0
ファイル: document.erp5.Item.py プロジェクト: dwtcourses/erp5
   def generateNewId(self,
                     id_group='item_id_group',
                     default=None,
                     method=None):
       """
 We want a different id for all Item
 """
       return XMLObject.generateNewId(self,
                                      id_group=id_group,
                                      default=default,
                                      method=method)
コード例 #10
0
    def _edit(self, edit_order=(), **kw):
        """Overloaded _edit to support setting debit and credit at the same time,
    which is required for the GUI.
    Also sets the variation category list and property dict at the end, because
    _setVariationCategoryList and _setVariationPropertyDict needs the resource
    to be set.
    """
        quantity = 0
        if 'source_debit' in kw and 'source_credit' in kw:
            source_credit = kw.pop('source_credit') or 0
            source_debit = kw.pop('source_debit') or 0
            quantity += (source_credit - source_debit)
            kw['quantity'] = quantity
            kw['cancellation_amount'] = (source_credit < 0 or source_debit < 0)
        if 'destination_debit' in kw and 'destination_credit' in kw:
            destination_credit = kw.pop('destination_credit') or 0
            destination_debit = kw.pop('destination_debit') or 0
            quantity += (destination_debit - destination_credit)
            kw['quantity'] = quantity
            kw['cancellation_amount'] = (destination_credit < 0
                                         or destination_debit < 0)

        # If both asset debit and asset credit are passed, we have to take care not
        # to erase the asset price if one of them is unset.
        if kw.get('source_asset_debit') or kw.get('source_asset_credit'):
            if kw.get('source_asset_debit') in (None, ''):
                kw.pop('source_asset_debit', None)
            if kw.get('source_asset_credit') in (None, ''):
                kw.pop('source_asset_credit', None)
        if kw.get('destination_asset_debit') or kw.get(
                'destination_asset_credit'):
            if kw.get('destination_asset_debit') in (None, ''):
                kw.pop('destination_asset_debit', None)
            if kw.get('destination_asset_credit') in (None, ''):
                kw.pop('destination_asset_credit', None)

        if not edit_order:
            edit_order = (
                'variation_category_list',
                'variation_property_dict',
            )
        return XMLObject._edit(self, edit_order=edit_order, **kw)
コード例 #11
0
ファイル: Movement.py プロジェクト: Verde1705/erp5
  def _edit(self, edit_order=(), **kw):
    """Overloaded _edit to support setting debit and credit at the same time,
    which is required for the GUI.
    Also sets the variation category list and property dict at the end, because
    _setVariationCategoryList and _setVariationPropertyDict needs the resource
    to be set.
    """
    quantity = 0
    if 'source_debit' in kw and 'source_credit' in kw:
      source_credit = kw.pop('source_credit') or 0
      source_debit = kw.pop('source_debit') or 0
      quantity += (source_credit - source_debit)
      kw['quantity'] = quantity
      kw['cancellation_amount'] = (source_credit < 0 or source_debit < 0)
    if 'destination_debit' in kw and 'destination_credit' in kw:
      destination_credit = kw.pop('destination_credit') or 0
      destination_debit = kw.pop('destination_debit') or 0
      quantity += (destination_debit - destination_credit)
      kw['quantity'] = quantity
      kw['cancellation_amount'] = (destination_credit < 0 or destination_debit < 0)

    # If both asset debit and asset credit are passed, we have to take care not
    # to erase the asset price if one of them is unset.
    if kw.get('source_asset_debit') or kw.get('source_asset_credit'):
      if kw.get('source_asset_debit') in (None, ''):
        kw.pop('source_asset_debit', None)
      if kw.get('source_asset_credit') in (None, ''):
        kw.pop('source_asset_credit', None)
    if kw.get('destination_asset_debit') or kw.get('destination_asset_credit'):
      if kw.get('destination_asset_debit') in (None, ''):
        kw.pop('destination_asset_debit', None)
      if kw.get('destination_asset_credit') in (None, ''):
        kw.pop('destination_asset_credit', None)

    if not edit_order:
      edit_order = ('variation_category_list', 'variation_property_dict',)
    return XMLObject._edit(self, edit_order=edit_order, **kw)
コード例 #12
0
ファイル: Movement.py プロジェクト: bhuvanaurora/erp5
    def _edit(self, edit_order=(), **kw):
        """Overloaded _edit to support setting debit and credit at the same time,
    which is required for the GUI.
    Also sets the variation category list and property dict at the end, because
    _setVariationCategoryList and _setVariationPropertyDict needs the resource
    to be set.
    """
        quantity = 0
        if "source_debit" in kw and "source_credit" in kw:
            source_credit = kw.pop("source_credit") or 0
            source_debit = kw.pop("source_debit") or 0
            quantity += source_credit - source_debit
            kw["quantity"] = quantity
            kw["cancellation_amount"] = source_credit < 0 or source_debit < 0
        if "destination_debit" in kw and "destination_credit" in kw:
            destination_credit = kw.pop("destination_credit") or 0
            destination_debit = kw.pop("destination_debit") or 0
            quantity += destination_debit - destination_credit
            kw["quantity"] = quantity
            kw["cancellation_amount"] = destination_credit < 0 or destination_debit < 0

        # If both asset debit and asset credit are passed, we have to take care not
        # to erase the asset price if one of them is unset.
        if kw.get("source_asset_debit") or kw.get("source_asset_credit"):
            if kw.get("source_asset_debit") in (None, ""):
                kw.pop("source_asset_debit", None)
            if kw.get("source_asset_credit") in (None, ""):
                kw.pop("source_asset_credit", None)
        if kw.get("destination_asset_debit") or kw.get("destination_asset_credit"):
            if kw.get("destination_asset_debit") in (None, ""):
                kw.pop("destination_asset_debit", None)
            if kw.get("destination_asset_credit") in (None, ""):
                kw.pop("destination_asset_credit", None)

        if not edit_order:
            edit_order = ("variation_category_list", "variation_property_dict")
        return XMLObject._edit(self, edit_order=edit_order, **kw)
コード例 #13
0
 def edit(self, **kw):
   XMLObject.edit(self, **kw)
コード例 #14
0
 def manage_beforeDelete(self, *args, **kw):
   try:
     del(memcached_dict_pool.memcached_dict)
   except AttributeError:
     pass
   XMLObject.manage_beforeDelete(self, *args, **kw)
コード例 #15
0
ファイル: ExtFolder.py プロジェクト: smetsjp/erp5
 def manage_beforeDelete(self, item, container):
   """Called before deleting this object.
   """
   self._v_deletion = Deletion(self._getRepositoryPath())
   XMLObject.manage_beforeDelete(self, item, container)
コード例 #16
0
ファイル: Item.py プロジェクト: MarkTang/erp5
 def generateNewId(self, id_group='item_id_group', default=None, method=None):
   """
   We want a different id for all Item
   """
   return XMLObject.generateNewId(self, id_group=id_group, default=default, method=method)
コード例 #17
0
 def manage_afterAdd(self, *args, **kw):
   try:
     del(memcached_dict_pool.memcached_dict)
   except AttributeError:
     pass
   XMLObject.manage_afterAdd(self, *args, **kw)
コード例 #18
0
 def manage_afterAdd(self, item, container):
     XMLObject.manage_afterAdd(self, item, container)
     Image.manage_afterAdd(self, item, container)
コード例 #19
0
 def __init__(self, id, **kw):
     Image.__init__(self, id, **kw)
     XMLObject.__init__(self, id, **kw)
コード例 #20
0
 def getTypeInfo(self, *args):
     if args:
         return self.getParentValue().getTypeInfo(*args)
     return XMLObject.getTypeInfo(self)
コード例 #21
0
 def manage_afterClone(self, item):
     XMLObject.manage_afterClone(self, item)
     Image.manage_afterClone(self, item)
コード例 #22
0
 def manage_afterAdd(self, item, container):
     XMLObject.manage_afterAdd(self, item, container)
     Image.manage_afterAdd(self, item, container)
コード例 #23
0
 def __init__(self, id, **kw):
     Image.__init__(self, id, **kw)
     XMLObject.__init__(self, id, **kw)
コード例 #24
0
ファイル: PythonScript.py プロジェクト: Verde1705/erp5
 def edit(self, **kw):
   XMLObject.edit(self, **kw)
コード例 #25
0
ファイル: ERP5Type.py プロジェクト: ccwalkerjm/erp5
 def getTypeInfo(self, *args):
   if args:
     return self.getParentValue().getTypeInfo(*args)
   return XMLObject.getTypeInfo(self)
コード例 #26
0
 def manage_afterClone(self, item):
     XMLObject.manage_afterClone(self, item)
     Image.manage_afterClone(self, item)