(self)
return factory
Returns the factory method that will create temp object.

    This method must return a function that accepts properties keywords
    arguments and returns a temp object edited with those properties.
Returns the factory method that will create temp object.
Returns the factory method that will create temp object .
def _getTempObjectFactory(self):
    """Returns the factory method that will create temp object.

    This method must return a function that accepts properties keywords
    arguments and returns a temp object edited with those properties.
    """
    # When have to reindex temp objects with quantity 0 in
    # order to update stock if delta become 0, but but redefining
    # isMovement we do not insert 0 lines in stock
    def isMovement(self):
      return self.getProperty('total_price', 0) != 0 or \
             self.getProperty('quantity', 0) != 0
    def factory(*args, **kw):
      doc = self.newContent(temp_object=True,
                            portal_type='Accounting Transaction Line',
                            id=kw.pop('id', self.getId()),
                            uid=self.getUid())
      doc.portal_type = 'Balance Transaction Line'
      relative_url = kw.pop('relative_url', None)
      destination_total_asset_price = kw.pop('total_price', None)
      if destination_total_asset_price is not None:
        kw['destination_total_asset_price'] = destination_total_asset_price
      doc._edit(*args, **kw)
      doc.isMovement = types.MethodType(isMovement, doc)

      if relative_url:

        def URLGetter(url):
          def getRelativeUrl():
            return url
          return getRelativeUrl
        doc.getRelativeUrl = URLGetter(relative_url)

        def PathGetter(path):
          def getPath():
            return path
          return getPath
        doc.getPath = PathGetter(relative_url)

      return doc

    return factory
def _getTempObjectFactory ( self ) : # When have to reindex temp objects with quantity 0 in # order to update stock if delta become 0, but but redefining # isMovement we do not insert 0 lines in stock def isMovement ( self ) : return self . getProperty ( 'total_price' , 0 ) != 0 or self . getProperty ( 'quantity' , 0 ) != 0 def factory ( * args , * * kw ) : doc = self . newContent ( temp_object = True , portal_type = 'Accounting Transaction Line' , id = kw . pop ( 'id' , self . getId ( ) ) , uid = self . getUid ( ) ) doc . portal_type = 'Balance Transaction Line' relative_url = kw . pop ( 'relative_url' , None ) destination_total_asset_price = kw . pop ( 'total_price' , None ) if destination_total_asset_price is not None : kw [ 'destination_total_asset_price' ] = destination_total_asset_price doc . _edit ( * args , * * kw ) doc . isMovement = types . MethodType ( isMovement , doc ) if relative_url : def URLGetter ( url ) : def getRelativeUrl ( ) : return url return getRelativeUrl doc . getRelativeUrl = URLGetter ( relative_url ) def PathGetter ( path ) : def getPath ( ) : return path return getPath doc . getPath = PathGetter ( relative_url ) return doc return factory