Ir al contenido
Menú
Se marcó esta pregunta
5 Respuestas
1320 Vistas

I'm getting this error when installing a third party app from the store.


Error while importing module 'dental_clinical_management'.

 while parsing /tmp/tmp9uhqovdm/dental_clinical_management/security/dental_clinical_management_security.xml:4, somewhere inside
<record id="own_dental_appointments" model="ir.rule">
        <field name="name">Own Appointments</field>
        <field name="model_id" ref="model_dental_appointment"/>
        <field name="domain_force">[('doctor_id.user_id', '=', user.id)]</field>
        <field name="groups" eval="[Command.link(ref('dental_clinical_management.group_dental_doctor'))]"/>
    </record> 

I have checked that all app dependencies are installed.

If I install the app using the method described in this post (forum/help-1/install-3rd-party-app-176360) then I can't see the app in the menu list unless I have superuser activated.

How can I fix this? Appreciate any help/advice.

Avatar
Descartar
Mejor respuesta

Hi,

Please refer to the code below:


<record id="own_dental_appointments" model="ir.rule">

    <field name="name">Own Appointments</field>

    <field name="model_id" ref="model_dental_appointment"/>

    <field name="domain_force">[('doctor_id.user_id', '=', user.id)]</field>

    <field name="groups" eval="[(4,

    ref('dental_clinical_management.group_dental_doctor')]"/>

</record>


Hope it helps.

Avatar
Descartar
Mejor respuesta

Hi Andrew,

The error you're getting is because Odoo can't find the model reference model_dental_appointment during module installation. This usually happens when the model isn't defined or loaded before the security file is parsed.

Make sure your model class is defined like this:

class DentalAppointment(models.Model):

    _name = 'dental.appointment'


Odoo auto-generates model_dental_appointment from _name = 'dental.appointment'. Also check your __manifest__.py and ensure the model is loaded before the XML file. The usual order is:

'data': [

    'security/ir.model.access.csv',

    'security/dental_clinical_management_security.xml',

    'views/...',

]


For the app not showing in the menu , activate Developer Mode, go to Settings > Users, open your user, and make sure you're added to the right group (like Dental Doctor). If the group isn't assigned, the menus will be hidden for normal users.

Thanks

Avatar
Descartar
Mejor respuesta

The error “Invalid Operation: Error while importing module 'dental_clinical_management'” means there’s a problem in your module code. Check the following:

  • Make sure __init__.py and __manifest__.py are correct.
  • Look for any syntax or import errors in your Python files.
  • Ensure all dependencies are listed in depends and installed.
  • Verify your XML files are well-formed and listed in data.
  • Follow the correct folder structure (models, views, etc.

Avatar
Descartar
Autor Mejor respuesta

Hi Niyas,

Thanks for the suggestion. The app is installed.

However, as you predicted, I can't see the app. I tried to activate the user groups as you suggested. I tried Settings > Users & Companies > Groups but there's no option to activate the groups.

Sorry, I am noob to Odoo. Appreciate if you could point me in the right direction.

Thanks

Avatar
Descartar
Mejor respuesta

Hi,
Seems you are importing the app from the user interface, which is not a recommend and supported method, if there is python files in the app.

In this case, you have opt (may be you already done),
* Download the app
* Extract it and add to addons path
* restart the odoo service
* hit update app list and install the app

After installing, if you are not able to see the app, there may be some user groups, you need to activate, which you can see from the users form view

Thanks 

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 25
12226
0
nov 24
1570
0
nov 24
1135
0
may 24
1326
4
jun 25
1013