コード例 #1
0
ファイル: consumer.py プロジェクト: tumanoff/connector-drupal
def delay_export_all_bindings(session, model_name, record_id, vals):
    """ Delay a job which export all bindings record
    (A binding record being a ``drupal.res.partner``)
    """
    if session.context.get('connector_no_export'):
        return
    export_record.delay(session, model_name, record_id)
コード例 #2
0
def delay_export_all_bindings(session, model_name, record_id, vals):
    """ Delay a job which export all bindings record
    (A binding record being a ``drupal.product.node`` or
    ``drupal.product.category``)
    """
    if session.context.get('connector_no_export'):
        return
    export_record.delay(session, model_name, record_id)
コード例 #3
0
def export_pricelist(session, model_name, record_id, vals):
    """ Delay a job which export a binding record.

    (A binding record being a ``drupal.res.partner``,
    ``drupal.product.product``, ...)
    """
    if session.context.get('connector_no_export'):
        return
    fields = vals.keys()
    export_record.delay(session, model_name, record_id, fields=fields)
コード例 #4
0
def export_pricelist(session, model_name, record_id, vals):
    """ Delay a job which export a binding record.

    (A binding record being a ``drupal.res.partner``,
    ``drupal.product.product``, ...)
    """
    if session.context.get('connector_no_export'):
        return
    fields = vals.keys()
    export_record.delay(session, model_name, record_id, fields=fields)
コード例 #5
0
ファイル: consumer.py プロジェクト: sc4you/connector-drupal
def delay_export_node_bindings(session, model_name, record_id, vals):
    """ Delay a job which export all the bindings of a record.

    In this case, it is called on records of normal models and will delay
    the export for all the bindings.
    """
    if session.context.get('connector_no_export'):
        return
    model = session.pool.get(model_name)
    record = model.browse(
        session.cr, session.uid, record_id, context=session.context
    )
    fields = vals.keys()
    for binding in record.drupal_node_bind_ids:
        export_record.delay(
            session, binding._model._name, binding.id, fields=fields
        )
コード例 #6
0
def delay_export_node_bindings(session, model_name, record_id, vals):
    """ Delay a job which export all the bindings of a record.

    In this case, it is called on records of normal models and will delay
    the export for all the bindings.
    """
    if session.context.get('connector_no_export'):
        return
    model = session.pool.get(model_name)
    record = model.browse(
        session.cr, session.uid, record_id, context=session.context
    )
    fields = vals.keys()
    for binding in record.drupal_node_bind_ids:
        export_record.delay(
            session, binding._model._name, binding.id, fields=fields
        )