Hi All,
I have found the solution using ERPPeek lib. which using xmlrpc lib itself.
1. Here is the example, by using I found out Database ID of csv ID.
import erppeek
client = erppeek.Client('http://localhost:8888', 'database_name', 'username', 'pass')
model_data = client.model('ir.model.data')
source_data = model_data.search_read([('model','=','model_name'), ('name','=',external_csv_id)], ['res_id'])
The source data returns database ID as res_id.
This works perfectly if data loaded through csv file.
2. Here is the method Which I have tried to search database ID of record which have been imported using XML IDs.
import erppeek
client = erppeek.Client('http://localhost:8888', 'database_name', 'username', 'pass')
model_data = client.model('ir.model.data')
result = model_data.xmlid_lookup("%s.%s" % ('module_name', xml_id))
It returns the list of 3 items.
1 values is backend external ID
2. Model Name
3. Database ID.
o/p E.g. : [2172, 'res.groups', 3]
This is How, I found solution to get the database ID of the records with reference of XML ID.
works like a charm.
Regards,
Anil.