Reputation: 25
openerp.py
'depends': ['base','hr'],
# always loaded
'data': [
'security/ir.rule.xml',
'security/ir.model.access.csv',
'views/views.xml',
],
security/ir.rule.xml
<data noupdate="0">
<record id="property_rule_jj_loan_creator" model="ir.rule" forcecreate="True">
<field name="name">loan creator</field>
<field name="model_id" ref="model_jj_loan"/>
<field name="domain_force">[('employee_id.user_id','=',user.id), ('state', '=', 'Draft')]</field>
<field name="perm_create" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
after restart odoo and update the model the error said:
raise ValueError('External ID not found in the system: %s' % (xmlid)) ParseError: "External ID not found in the system: model_jj_loan" while parsing /home/addons/jj_loan/security/ir.rule.xml:4, near
I have seen many examples codes are the same as mine, so is there anything I have missed?
thank you :)
Upvotes: 1
Views: 724
Reputation: 14751
error is about the name of the model : model_jj_loan
the Model jj.loan is not created on you database:
check the name of your model must be like this if not you need to change the name on the xml file :
_name = 'jj.loan'
if is there with the same name than you need to check if the table is created on your database use pgAdmin and i think you will not found it. if so :
make sure that you import the you module .py
in the __init__.py
because odoo will not install a model on the database if it does not exists in __init__.py
put the model code in the question if you didn't solve the prob
Upvotes: 1