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

How to send a default model_id in a view? (old api)

By
Anabela Damas
on 4/7/15, 11:09 AM 532 views

Hello,

I wanted that my object have a relation  many2one with email.template and the domain of this field is just the email.template that have the model_id with the value 'hr.evaluation.interview'. 

I tryed like this:

<field name="template_id" domain="[('model_id','=','hr.evaluation.interview')]" context="{'default_model_id':'hr.evaluation.interview' }"/>

But it craches: 

invalid input syntax for integer: "hr.evaluation.interview"

I try like this <field name="template_id" domain="[('model_id','=','hr.evaluation.interview')]" context="{'default_model_id':ref('hr.evaluation.interview') }"/>

and like this : 

<field name="template_id" domain="[('model_id','=',[ref('mb_boldint_hr_evaluation.model_hr_evaluation_interview')])]" context="{'default_model_id': [ref('mb_boldint_hr_evaluation.model_hr_evaluation_interview')] }"/>

But it doesn't know the ref. 

Do you know how can I do this? 

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

1 follower(s)

Stats

Asked: 4/7/15, 11:09 AM
Seen: 532 times
Last updated: 4/9/15, 5:26 AM