Source code for odoo_xmlrpc_twisted.functions.count_product_place
"""Return the number of products in a place for a customer."""# call the function "get_settings_odoo" to get the parameters# for the logging of the model on the "odoo Webservice API"try:from.get_settings_odooimportget_settings_odooexceptImportError:fromget_settings_odooimportget_settings_odooresult=get_settings_odoo()db=result[0]uid=result[1]password=result[3]models=result[4]
[docs]defcount_product_place(partner_id,place):""" Function returns how many of the customer's items belong to a particular place. """count=0if(partner_id!='')and(place!=''):# get the number of products with the specific place belonging to the clientcount=models.execute_kw(db,uid,password,'product.product','search_count',[[['x_partner_id','=',partner_id],['x_place','=',place]]])return(count)