Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4439 Переглядів

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}



Аватар
Відмінити

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.

Автор

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 Відповіді Переглядів Дія
Odoo Mail Sending Limit Вирішено
2
груд. 23
15309
0
жовт. 23
33
3
жовт. 23
790
1
жовт. 23
569
1
серп. 23
2769