Source code for odoo_xmlrpc_twisted.functions.update_product
"""Module updates a product"""# 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]defupdate_product(product_id,name,description):""" Functions updates a product with name and description. """result=Falseifproduct_id!='':# update the productresult=models.execute_kw(db,uid,password,'product.product','write',[[product_id],{'name':name,'description':description}])return(result)