Help

1

Error: No matching record found for external id csv file

Avatar
Jeff
Exception: Module loading hr_daily_task failed: file hr_daily_task/security/ir.model.access.csv could not be processed:
 No matching record found for external id 'base.model_daily_task' in field 'Object'
No matching record found for external id 'model_daily_task' in field 'Object'
No matching record found for external id 'hr_daily_task.group_daily_task_employee' in field 'Group'
No matching record found for external id 'model_daily_task' in field 'Object'
No matching record found for external id 'hr_daily_task.group_daily_task_dept_head' in field 'Group'
No matching record found for external id 'model_daily_task' in field 'Object'
No matching record found for external id 'hr_daily_task.group_daily_task_manager' in field 'Group'
No matching record found for external id 'model_daily_task_work' in field 'Object'
No matching record found for external id 'model_associated_company' in field 'Object'
Missing required value for the field 'Object' (model_id)
Missing required value for the field 'Object' (model_id)

This my csv:

access_daily_task_employee,access.daily.task.employee,model_daily_task,hr_daily_task.group_daily_task_employee,1,1,1,0
access_daily_task_dept_head,access.daily.task.dept.head,model_daily_task,hr_daily_task.group_daily_task_dept_head,1,1,1,0
access_daily_task_manager,access.daily.task.manager,model_daily_task,hr_daily_task.group_daily_task_manager,1,1,1,1

How to solve this?


Avatar
Discard
1 Answer
3

HI Jeff,

As i can see here in your csv file, you use the model "daily.task" in the security csv file without module name so system takes base as module name "base.model_daily_task".

But this model is not related to the base addons of odoo12. This must be from the custom addons of yours. So the CSV Security model definetion will be like this:
                        "Module_name.model_model_name"

Lets take an example of account move from the account module.
                        "account.model_account_move"

Please define all the model column data as the above format.
Lets take your current situation, the module name might be hr_daily_task and model name is "daily.task",
So the model data in csv should be "hr_daily_task.model_daily_task"

Also please check dependency of the modules if you are use the custom ones.

Hope it will help you.
Please vote.

7 Comments
Avatar
Discard
Avatar
Jeff
-

Hi Khamar,

I've already tried adding the hr_daily_task.model_daily_task but it's still not working. Also I think there's a difference between odoo12 and odoo14. My module (hr_daily_task) was from odoo14. I just copy it and paste it in odoo12.

I tried to download some free odoo14 module in app store and tested it to install in both version. But it seems it only works in odoo14 and no errors has shown, but in odoo12, I got the errors from the above. I compared the code between the two version, I think it's already fine, but I don't know why I'm still getting the error in odoo12. May I ask if there's a difference around the module (security, manifest, models and so on) between the two both version?

Hi Jeff,

Yes there are difference in odoo12 and odoo14. Major one is the @api.multi.

But i am assuming that you have load your security group file first before the security access file. just like:
'security/hr_daily_task.xml',
'security/ir.model.access.csv',

Also the module init and models init files too.
Hope it will work for you.

Avatar
Jeff
-

I've also tried to arrange the order but I still got an error. If I loaded up the security.xml first, this is the error that I've got?

<record model="ir.rule" id="employee_record_rule">
<field name="name">See only his/her tasks</field>
<field name="model_id" ref="model_daily_task"/>
<field name="domain_force">[('user_id','=',user.id)]</field>
<field name="groups" eval="[(4, ref('group_daily_task_employee'))]"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_write" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_create" eval="True"/>
</record>

But if the csv is first, I will get the error from my post. Also, I have already added the _init_.py in my models folder and that model folder was also added in my main _init_.py But it's still not working for me. What should I do? It seems like it didn't recognize my module at all.

You can try install the Planning CE by Vertel Ab and install it on odoo12, the error I've got was just the same from my post (just the error only and not model/module name).

Avatar
Jeff
-

These are the imports from odoo14 that I copied in models folder > models.py, is there any of these that are not compatible with odoo12?

from datetime import datetime, date, timedelta, time
from odoo import models, fields, api, _
from odoo.exceptions import AccessError, UserError, ValidationError
from odoo import SUPERUSER_ID, tools
from odoo.tools.float_utils import float_round
from odoo.addons.resource.models.resource import float_to_time, HOURS_PER_DAY
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
import pytz
import datetime

Avatar
Jeff
-

And maybe those imports may requires a package that is needed to be install in terminal and perhaps that's the reason that my csv file is not reading my models.py? Am I right?

Yes Jeff,

But on my advice, you first need to migrate that module according to the odoo 12 standards and then you can install it in the odoo12 environment. If you install odoo14 module into odoo12 environment, then you have to face these types of issues.

Hope it will help you.
Thanks

Avatar
Jeff
-

i can't really solve it. Is there any solution for this?