No matching record found for external id Odoo 12 csv file

Viewed 32

I'm installing my custom module that I copy from Odoo 14 to Odoo 12 and I'm getting this error:

No matching record found for external id 'hr_daily_task.group_daily_task_employee' in field 'Group'

Missing required value for the field 'Object' (model_id) 

No matching record found for external id 'model_daily_task' in field 'Object'

This is my model:

class DailyTask(models.Model):

    _name = "daily.task"

    _description: "Daily Task"`enter code here`

This is my csv:

access_daily_task_employee,access.daily.task.employee,model_daily_task,hr_daily_task.group_daily_task_employee,1,1,1,0

My Security:

<record model="ir.module.category" id="module_category_hr_daily_task">
<field name="name">HR Daily Employee Task</field>
<field name="description" >Daily Records of employee tasks</field>
<field name="sequence">45</field>
</record>

<record id="group_daily_task_employee" model="res.groups">
<field name="name">Employee
<field name="category_id" ref="module_category_hr_daily_task"/>
</record>

I've already tried several solution with the following:

  1. Add module_name.model_name (hr_daily_task.model_daily_task) in both csv file and security
  2. Reboot server
  3. Update Apps List in Odoo
  4. Import in init.py file for both models folder and main init.py file

I've tried all of them but still not working for me.

But if I install it in Odoo 14, it's working. Also, I've tried to install Planning CE by Vertel AB (Odoo 14) in Odoo 12, I've also got the same error but it also works in Odoo 14.

Please help me to solve this, I can't really find any solution for this. You may try to install Planning CE by Vertel Ab in Odoo 12 so that you can try and fix the problem and please share the solution if you find one.

Thanks in advance.

1 Answers

No matching record found for external id 'hr_daily_task.group_daily_task_employee' in field 'Group'

This can be one of the following:

  1. This is not the right external ID
  2. The CSV file is imported before the security file (The file where you defined the groups)
  3. The security file is not imported

No matching record found for external id 'model_daily_task' in field 'Object'

Check module imports, probably you forgot to import the file where you defined the daily.task model

Related