Skip to Content
Menu
This question has been flagged
3429 Views

As I know from other thread. External ID is identical with XML ID stored in ir_model_data .

But I curious with this scenario.

Data Import for Users

External ID: 888, Name: David -> External ID view  metadata  is  __import__.888

Data Import for Employee

External ID: 888, Name: David -> External ID view  metadata  is  __import__.249

Data Import for Attendance

Employee/External ID: 888, IN: 2021-08-20 09:05:51 -> this data successfully imported and related with data employee.

My question is where the "888" value stored in database?


I trace and checking the code goes to here and no clue to find that.

the code  inside  models.py 

print('before magic')
print(record)
# {'check_in': '2021-08-20 09:05:51', 'employee_id': [{'id': '888'}]}
converted = convert(record, functools.partial(_log, extras, stream.index))
print('magic')
print(converted)
# {'check_in': '2021-08-20 09:05:51', 'employee_id': 476}



Avatar
Discard

Are you sure Users and Employees are on the same model?
It seems like there's 2 models, 'res.users' and 'res.partner' are in relation, therefore their database ID would be different.

Author

Database ID yes, of course different each model.
I curious about the External ID. I test import data with same value (ex: 888) for external ID column. Odoo can handle with great algorithm. Odoo recognise External ID 888 for model res.users and 888 for model res.employee. If check the 888 value in database, I just see in table ir_model_data (the column is name), it's also known as XML ID. But in that table just show 1 row, 888 for model res.users

Related Posts Replies Views Activity
2
Dec 23
12010
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569
1
Aug 23
982