Odoo Help


write on many2many field

Edson Murima
on 10/17/16, 6:17 AM 894 views

hii... iam using a 6.0 version of "openerp" and iam trying to write on many2many field 


    'referencia' : fields.char("Referência",size=64, required=True),

    'data_consulta' : fields.date("Data da Consulta", required=True, readonly=False),

   'especialidade' : fields.many2one('dotcom.consutorio.especialidades',"Especialidade"),     'lista_medicos_por_especialidade':         fields.many2many('dotcom.consutorio.medicos','rel_consulta_medicos','medicos_id','consutas_id'), }

the method is on the same class ...dont give any error but do not fill the

list medicos_ids=self.pool.get('dotcom.consutorio.medicos').search(cr,uid,[ ('especialidade','=',documento.especialidade.id)]) self.write(cr,uid,ids,{'lista_medicos_por_especialidade':[(medicos_ids,5)]}) return True

contains elements!

Edson Murima
on 10/17/16, 8:08 AM
--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 10/17/16, 7:13 AM


did the medicos_ids contains elements or it always return empty list ?

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/17/16, 6:17 AM
Seen: 894 times
Last updated: 10/17/16, 9:40 AM