Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Help conditions domain

By
lam a bao
on 12/8/13, 11:14 PM 569 views

Hi erveryone

 class cvs_quotations_class_formula(osv.osv):
_name="cvs.quotations.class.formula"
def _checkIsGlass(self,cr,uid,ids,context=None):

    result=[]
    oj_cate=self.pool.get('product.category')
    search_cate=oj_cate.search(cr,uid,[('type_cate','=',3)])
    data_cate=oj_cate.read(cr,uid,search_cate,['id'],context)
    for item in data_cate:
        result.append(int(item['id']))

    return result
_columns={
    "codedoorsystem":fields.many2one('product.category', "Chọn hệ cửa",required=True,translate=True,domain=[('parent_id','=',3)]),
    "codeglass":fields.many2one("product.template","Chọn Kính",translate=True,domain=[('categ_id','in',_checkIsGlass)]),
    "formula_glass":fields.char("Công Thức Kính",translate=True),
}

cvs_quotations_class_formula()

I want to get data from a function to put domain conditions, but it error

Can you help me ?

thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 12/8/13, 11:14 PM
Seen: 569 times
Last updated: 3/16/15, 8:10 AM