تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2150 أدوات العرض

Error while importing module 'intern'. while parsing /tmp/tmpzrcd6djb/intern/views/intern_intern_view.xml:3 Ocurrió un error al validar vista cercana

Modelo no encontrado: intern.intern View error context: {'file': '/tmp/tmpzrcd6djb/intern/views/intern_intern_view.xml', 'line': 2, 'name': 'intern.intern.form', 'view': ir.ui.view(3497,), 'view.model': 'intern.intern', 'view.parent': ir.ui.view(), 'xmlid': 'view_intern_intern_form'} Make sure those modules are installed and try again. 

 My manifesto:

{   'name': 'Intern Manager',    'version': '1.0',    'category': 'Human Resources',    'summary': 'Manage Interns',    'sequence': 10,     'author': 'Ivan Perez Cruzado, Jose Manuel Reyes Jimenez',    'license': 'LGPL-3',    'depends': ['base'],   'data': [    'models/models.py',    'views/intern_intern_view.xml',  # Este archivo define el modelo 'intern.intern' que es referenciado por los demás, así que lo cargamos primero    'views/intern_course_view.xml',    'views/intern_meeting_view.xml',    'views/intern_task_view.xml',    'views/intern_work_log_view.xml',    'security/ir.model.access.csv',    ],      'images': ['static/description/icon.png'],    'installable': True,    'application': True,    'auto_install': True,}
My init: 

# -*- coding: utf-8 -*-from . import modelsfrom . import controllers

الصورة الرمزية
إهمال
الكاتب

Este es mi model: from odoo import api, fields, models, exceptions

class Intern(models.Model):
_name = 'intern.intern'
_description = 'Intern'

name = fields.Char(string='Intern Name', required=True)
tutor_id = fields.Many2one('res.users', string='Assigned Tutor')
start_date = fields.Date(string='Start Date')
end_date = fields.Date(string='End Date')
description = fields.Text(string='Description')
task_ids = fields.One2many('intern.task', 'intern_id', string='Tasks')
course_ids = fields.Many2many('intern.course', string='Courses')
meeting_ids = fields.One2many('intern.meeting', 'intern_id', string='Meetings')
work_log_ids = fields.One2many('intern.work_log', 'intern_id', string='Work Logs')

أفضل إجابة

Hi,
- Ensure 'models': ['intern.intern'] is included in __manifest__.py.
- Verify the model path in intern_intern_view.xml is correct (intern.intern).
- Confirm file locations:
  1- intern.py in models directory
  2- intern_intern_view.xml in the views directory
 
- Double-check that the module is installed correctly and dependencies are met.
- If installation issues persist, consider reinstalling the module.
- Verify that Odoo has the necessary permissions to access module files.

Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مارس 15
4185
1
مارس 15
4798
4
مايو 24
6378
0
فبراير 20
32
1
نوفمبر 18
5500