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

default value for many2one field

By
Maniganda
on 7/18/13, 7:11 AM 2,403 views

how to set default value for many2one field

1
Sreedath Namangalam
On 7/18/13, 8:52 AM

find the id of that default value and give it to the many2one field using _defaults = ...

I have to write a function for default

Maniganda
on 7/18/13, 11:14 AM

Suppose I have a many2many relationship from a module "x" with partners. then, the relationship of this many2many fields, becomes a many2one (between the items selected for partners and invoice). I have limited the domain for this relationship in the invoice using domain="[('partner_ids', '=', partner_id)] in the view. It works but now I want to get the first of these items (in the invoice) as the default one. So, actually I don't know the id of the item because it varies for each partner. I just want selected as default the first one in the list. How could I do this?

Daniel Blanco
on 4/10/15, 5:50 PM

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: 7/18/13, 7:11 AM
Seen: 2403 times
Last updated: 3/16/15, 8:10 AM