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

I'm trying to develop a module. I made simple changes to the equipment form inside maintenance module. But when I'm trying to install this module I get an error:

TypeError: Model 'maintenance' does not exist in registry.

In the manifest file I have maintenance inside dependencies:

'depends': ['base','web','maintenance'],

This is my models:

# -*- coding: utf-8 -*-
from odoo import models, fields, api
class custom_category_fields(models.Model):
    _inherit = 'maintenance.equipment'
    CPU1 = fields.Char()    
    GPU1 = fields.Char()

And this is my views:

<record model="ir.ui.view" id="view_equipment_form_inherit" >
     <field name="name">equipment.specs</field>
     <field name="model">maintenance.equipment</field>
     <field name="inherit_id" ref="maintenance.hr_equipment_view_form"/>
     <field name="arch" type="xml">
         <xpath expr="//field[@name='note']" position="after">
            <group>                
                <field name="CPU1"/>
            </group>
            <group>                
                <field name="GPU1"/>
            </group>
        </xpath>
    </field>
</record>

What is wrong?



الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Solution - restart the odoo service

sudo systemctl restart odoo.service 

:)


الصورة الرمزية
إهمال
أفضل إجابة

Hi, did you add the template to the security.csv file?

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

Yes, but I have found the solution - turn it off and on :)

المنشورات ذات الصلة الردود أدوات العرض النشاط
6
يناير 23
11257
0
أغسطس 19
3081
2
يونيو 20
5582
0
أبريل 19
3921
2
يناير 19
6359