Odoo Help

0

2
3 Answers
1
Ramsad pv
2018/5/23 上午1:05

which API are you using ??

 is it Odoo External Api ??.


In the Odoo External Api Documentation is explaining that ,  you can set the limit for the reading Records in Read and Search_read methods ,  and you can set the offset and the limit if need . refer the link

https://www.odoo.com/documentation/11.0/webservices/odoo.html

0
Benoît Vézina
2017/2/21 上午9:35

use fields as this example :

def getConvert(self, partner_id):
    modelName = 'membership.membership.line'                       
    domain = [ ('partner_id','=',partner_id )]       
    fields =[
            'id',
             'partner_id',
             'name', ]
        user = self.execute(modelName, 'search_read',    [domain,    fields])
        try :
            userId = user[0]['id']
            logger.info("converted ParterId :" + str(partner_id)+ " == UserId ids : " + str(userId))
        except IndexError as e:
            logger.warn(str(e) + "can not converted - no UserId for Partner:" + str(partner_id))
            userId = False
        return  userId

Ask a Question
Writer
Keep Informed
1 follower(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 E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now