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

Value field.selection not save when click button save

By
lam a bao
on 12/10/13, 5:50 AM 781 views

Hi everyone

    class cvs_quotations_class_formula(osv.osv):
        _name="cvs.quotations.class.formula"
        def _checkIsGlass(self,cr,uid,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']))
        oj_templete=self.pool.get('product.template')
        search_templete=oj_templete.search(cr,uid,[('categ_id','in',result)])
        data_templete=oj_templete.read(cr,uid,search_templete,['id','name'],context)
        return [(r['id'], r['name']) for r in data_templete]

      _columns={
    "codeglass":fields.selection(_checkIsGlass,"Chọn Kính",translate=True),

     }
    cvs_quotations_class_formula()

view :

    <field name="codeglass" ></field>

when i click button save, then value of selection not save

Can you hel me ? Thanks

Selection Field you are using method so i think not save in db. what your actual requirement

Prakash
on 12/10/13, 8:56 AM

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/10/13, 5:50 AM
Seen: 781 times
Last updated: 3/16/15, 8:10 AM