Skip to Content
Menu
This question has been flagged
1 Reply
1837 Views

how to create a record using XMLRPC and assigned id without it auto-incrementing?

Avatar
Discard
Best Answer
# db1_leads = models_1.execute_kw(db1, uid_db1, password1, 'product.uom.categ', 'search_read', [[]], {'fields': [
# 'name',
# ]})
# total_count=0
# for leads in db1_leads:
# total_count +=1
# print("LEADS :",leads)

# search_category_id = models_2.execute_kw(db2, uid_db2, password2, 'uom.category', 'search', [[['name', '=', leads['name']]]])
# if search_category_id:
# for categ_id in search_category_id:
# a = models_2.execute_kw(db2, uid_db2, password2, 'uom.category', 'write', [categ_id, {
# 'old_category_id': leads['id'],
# }])
# else:
# new_lead = models_2.execute_kw(db2, uid_db2, password2, 'uom.category', 'create', [{
# 'name' : leads['name'],
# 'old_category_id' : leads['id'],
# }])
# print("PHYTEC UOM CATEGORY Total Count :",total_count)


I think above code will help you, or
check this link :
https://www.odoo.com/documentation/13.0/webservices/odoo.html

Avatar
Discard