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

write on many2many field

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

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

_columns={

    '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
0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


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

hi,

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

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

1 follower(s)

Stats

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