Odoo Help


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.


Domain Function Odoo v8

on 4/13/15, 11:54 PM 1,682 views

hello guys, i just wanted to ask if it is possible to create a domain function for a m2* function?.


def get_domain(self):


return [('id', '=', domain)]

field_a = fields.Many2one('model', domain='get_domain')

it seems it is not working for me :( 

On 4/14/15, 3:07 AM

Hello @Ajeng Shilvie, 

thanks for your reply, but it does not work

Error : 

ProgrammingError: can't adapt type 'model_name'

Ajeng Shilvie
On 4/14/15, 12:58 AM

hi maximize :

try this, you don't have to insert domain in your field :

    def fiel_change(self):
        dom['field_a'] = [(*)] #* type your domain 
        return {'domain':dom}

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)


Asked: 4/13/15, 11:54 PM
Seen: 1682 times
Last updated: 4/14/15, 3:41 AM