Odoo Aide

0

0
2 Answers
0
Phillip
22/04/2015 11:31

Alright. So here is what worked for me in the end. 

#####################

@api.model

def _getClientId(self):

    if len(self.search_read([],[])) == 0:

        return [('client_id','=','client_id')]

    else:

        client_id = self.search_read([],['id'])[0].get('id')

        domain = "[('client_id','='," + " " + str(client_id) + ")]"

        return domain

selected_review = fields.Many2one('sentry.review',

domain=_getClientId,

string="Selected Review")

####################################

The issue is that I was referring to the wrong id.

Poser une question
Writer
Keep Informed
1 Abonné(e)s
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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now