当前位置: 首页>>代码示例>>Java>>正文


Java OColumn.ColumnDomain方法代码示例

本文整理汇总了Java中com.odoo.core.orm.fields.OColumn.ColumnDomain方法的典型用法代码示例。如果您正苦于以下问题:Java OColumn.ColumnDomain方法的具体用法?Java OColumn.ColumnDomain怎么用?Java OColumn.ColumnDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.odoo.core.orm.fields.OColumn的用法示例。


在下文中一共展示了OColumn.ColumnDomain方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
@Override
protected List<ODataRow> doInBackground(String... params) {
    try {
        ServerDataHelper helper = mRelModel.getServerDataHelper();
        ODomain domain = new ODomain();
        domain.add(mRelModel.getDefaultNameColumn(), "ilike", params[0]);
        if (mCol != null) {
            for (String key : mCol.getDomains().keySet()) {
                OColumn.ColumnDomain dom = mCol.getDomains().get(key);
                domain.add(dom.getColumn(), dom.getOperator(),
                        dom.getValue());
            }
        }
        OdooFields fields = new OdooFields(mRelModel.getColumns());
        return helper.searchRecords(fields, domain, 10);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:21,代码来源:SearchableItemActivity.java

示例2: getRecordItems

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
public static List<ODataRow> getRecordItems(OModel model, OColumn column) {
    List<ODataRow> items = new ArrayList<ODataRow>();

    OModel rel_model = model.createInstance(column.getType());
    StringBuffer whr = new StringBuffer();
    List<Object> args_list = new ArrayList<Object>();
    // Skipping onchange domain filter
    if (!column.hasDomainFilterColumn()) {
        for (String key : column.getDomains().keySet()) {
            OColumn.ColumnDomain domain = column.getDomains().get(key);
            if (domain.getConditionalOperator() != null) {
                whr.append(domain.getConditionalOperator());
            } else {
                whr.append(" ");
                whr.append(domain.getColumn());
                whr.append(" ");
                whr.append(domain.getOperator());
                whr.append(" ? ");
                args_list.add(domain.getValue().toString());
            }
        }
    }
    String where = null;
    String[] args = null;
    if (args_list.size() > 0) {
        where = whr.toString();
        args = args_list.toArray(new String[args_list.size()]);
    }
    List<ODataRow> rows = new ArrayList<>();
    rows = rel_model.select(new String[]{rel_model.getDefaultNameColumn()}, where,
            args, rel_model.getDefaultNameColumn());
    ODataRow row = new ODataRow();
    row.put(OColumn.ROW_ID, -1);
    row.put(rel_model.getDefaultNameColumn(), "No " + column.getLabel() + " selected");
    items.add(row);
    items.addAll(rows);
    return items;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:39,代码来源:OSelectionField.java

示例3: setOnDomainFilterCallBack

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
private void setOnDomainFilterCallBack(final OColumn column, OField field) {
    LinkedHashMap<String, OColumn.ColumnDomain> filterDomain = column
            .getFilterDomains();
    for (String key : filterDomain.keySet()) {
        OColumn.ColumnDomain domain = filterDomain.get(key);
        if (domain.getColumn() != null) {
            OField fld = mFormFieldControls.get(domain.getColumn());
            if (fld != null) {
                setFilterDomainCallback(domain, fld, field, column);
            }
        }
    }

}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:15,代码来源:OForm.java

示例4: setFilterDomainCallback

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
private void setFilterDomainCallback(OColumn.ColumnDomain domain,
                                     final OField field, final OField oField, final OColumn column) {
    field.setOnFilterDomainCallBack(domain, new IOnDomainFilterCallbacks() {

        @Override
        public void onFieldValueChanged(OColumn.ColumnDomain dm) {
            column.addDomain(dm.getColumn(), dm.getOperator(),
                    dm.getValue());
            column.setHasDomainFilterColumn(false);
            oField.setColumn(column);
            oField.resetData();
        }
    });
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:15,代码来源:OForm.java

示例5: setOnFilterDomainCallBack

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
/**
 * Domain Filters
 *
 * @param domain
 * @param callback
 */
public void setOnFilterDomainCallBack(OColumn.ColumnDomain domain,
                                      IOnDomainFilterCallbacks callback) {
    mColumnDomain = domain;
    mOnDomainFilterCallbacks = callback;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:12,代码来源:OField.java

示例6: onFieldValueChanged

import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
public void onFieldValueChanged(OColumn.ColumnDomain domain); 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:2,代码来源:IOnDomainFilterCallbacks.java


注:本文中的com.odoo.core.orm.fields.OColumn.ColumnDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。