Skip to Content
Menu
This question has been flagged
5 Replies
4869 Views

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 392, in _check_xml
    self.postprocess_and_fields(view.model, view_doc, view.id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 931, in postprocess_and_fields
    self.raise_view_error(_('Model not found: %(model)s') % dict(model=model), view_id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 592, in raise_view_error
    raise ValueError(message)
ValueError: Model not found: Transfers.name

Error context:
View `Money.Transfer.form`
[view_id: 385, xml_id: fetchmail.view_email_server_tree, model: Transfers.name, parent_id: n/a]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/odoo/odoo-server/odoo/models.py", line 4040, in _load_records
    data['record']._load_records_write(data['values'])
  File "/odoo/odoo-server/odoo/models.py", line 3978, in _load_records_write
    self.write(values)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/odoo/odoo-server/odoo/models.py", line 3556, in write
    fields[0].determine_inverse(real_recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1114, in determine_inverse
    getattr(records, self.inverse)()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/odoo/odoo-server/odoo/models.py", line 3551, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/odoo/odoo-server/odoo/models.py", line 1167, in _validate_fields
    check(self)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml
    raise ValidationError("%s\n\n%s" % (_("Error while validating view"), tools.ustr(e)))
odoo.exceptions.ValidationError: ('Error while validating view\n\nModel not found: Transfers.name\n\nError context:\nView `Money.Transfer.form`\n[view_id: 385, xml_id: fetchmail.view_email_server_tree, model: Transfers.name, parent_id: n/a]', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 619, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 309, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/odoo/odoo-server/odoo/http.py", line 664, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 345, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 93, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 338, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 910, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 510, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1324, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1312, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 387, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 374, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-64>", line 2, in button_immediate_upgrade
  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
    return method(self, *args, **kwargs)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 629, in button_immediate_upgrade
    return self._button_immediate_function(type(self).button_upgrade)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/odoo/odoo-server/odoo/modules/loading.py", line 419, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check)
  File "/odoo/odoo-server/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/odoo/odoo-server/odoo/modules/loading.py", line 225, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/odoo/odoo-server/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 736, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 803, in convert_xml_import
    obj.parse(doc.getroot())
  File "/odoo/odoo-server/odoo/tools/convert.py", line 721, in parse
    exc_info[2]
  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/odoo/odoo-server/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/odoo/odoo-server/odoo/models.py", line 4040, in _load_records
    data['record']._load_records_write(data['values'])
  File "/odoo/odoo-server/odoo/models.py", line 3978, in _load_records_write
    self.write(values)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/odoo/odoo-server/odoo/models.py", line 3556, in write
    fields[0].determine_inverse(real_recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1114, in determine_inverse
    getattr(records, self.inverse)()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/odoo/odoo-server/odoo/models.py", line 3551, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/odoo/odoo-server/odoo/models.py", line 1167, in _validate_fields
    check(self)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml
    raise ValidationError("%s\n\n%s" % (_("Error while validating view"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating view

Model not found: Transfers.name

Error context:
View `Money.Transfer.form`
[view_id: 385, xml_id: fetchmail.view_email_server_tree, model: Transfers.name, parent_id: n/a]
None" while parsing /odoo/odoo-server/addons/transfers/transfers.xml:2, near
<odoo>


    <record id="money_transfer" model="ir.ui.view">
           <field name="name">Money.Transfer.form</field>
           <field name="model">Transfers.name</field>
           <field name="arch" type="xml">
         <form string="money_transfers">
         <group>
         <field name="transfers_Name"/>
         <field name="transfers_ISO"/>
         <field name="transfers_amount"/>
         <field name="notes"/>
         <field name="image"/>
         </group>
         </form>          
           </field>
     </record>


    <record id="action_transfers" model="ir.actions.act_window">
           <field name="name">Transfers</field>
           <field name="type">ir.actions.act_window</field>
           <field name="res_model">transfers.name</field>
       <field name="view_mode">tree,form</field>
           <field name="help" type="html">
         <p class="o_view_nocontent_smiling_face">
           create your first transfer
         </p>           
           </field>
     </record>


    <menuitem id="transfers_root" name="Transfers" sequence="0" web_icon="transfers,static/description/icon.png"/> 
    <menuitem id="transfers_name" name="Transfers_Name" parent="transfers_root" action="action_transfers"/>


</odoo>

Avatar
Discard
Best Answer

Hi, Guna


Issue is due to the below form view. Actually inside this form "money_transfer" view you have defined wrong model.
Kindly update your model like below,

<record id="money_transfer" model="ir.ui.view">
  <field name="name">Money.Transfer.form</field>
  <field name="model">transfers.name</field>
           <field name="type">form</field>
  <field name="arch" type="xml">
<form string ="money_transfers">
<group>
<field name ="transfers_Name"/>
<field name ="transfers_ISO"/>
<field name ="transfers_amount"/>
<field name ="notes"/>
<field name ="image"/>
</group>
</form>  
  </field>
  </record>
Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited
Avatar
Discard

Hi, Guna

You forgot to pass type '<field name="type">form</field>' inside the form that's why you are getting this issue.

Kindly update you view like below,

<record id="money_transfer" model="ir.ui.view">

<field name="name">Money.Transfer.form</field>

<field name="model">transfers.name</field>

<field name="type">form</field>

<field name="arch" type="xml">

<form string ="money_transfers">

<group>

<field name ="transfers_Name"/>

<field name ="transfers_ISO"/>

<field name ="transfers_amount"/>

<field name ="notes"/>

<field name ="image"/>

</group>

</form>

</field>

</record>

I also updated my answer.

Thanks.

Ashish Singh

Author

yeah i have update the xml file but still iam getting the same error when trying to upgrade

Error:

Traceback:

TypeError: Cannot read property 'type' of undefined

at Class._renderBodyCell (http://localhost:8069/web/static/src/js/views/list/list_renderer.js:444:50)

at http://localhost:8069/web/static/src/js/views/list/list_renderer.js:838:25

at Array.map (<anonymous>)

at Class._renderRow [as _super] (http://localhost:8069/web/static/src/js/views/list/list_renderer.js:837:35)

at Class._renderRow (http://localhost:8069/web/static/src/js/views/list/list_editable_renderer.js:1166:32)

at Class._renderRow (http://localhost:8069/web/static/src/js/core/class.js:123:38)

at Array.map (<anonymous>)

at Class._renderRows (http://localhost:8069/web/static/src/js/views/list/list_renderer.js:858:32)

at Class._renderRows (http://localhost:8069/web/static/src/js/views/list/list_editable_renderer.js:1187:26)

at Class._renderRows (http://localhost:8069/web/static/src/js/core/class.js:123:38)

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<record id="money_transfer" model="ir.ui.view">

<field name="name">Money.Transfer.form</field>

<field name="model">transfers.name</field>

<field name="type">form</field>

<field name="arch" type="xml">

<form string ="money_transfers">

<group>

<field name ="transfers_Name"/>

<field name ="transfers_ISO"/>

<field name ="transfers_amount"/>

<field name ="notes"/>

<field name ="image"/>

</group>

</form>

</field>

</record>

<record id="action_transfers" model="ir.actions.act_window">

<field name="name">Transfers</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">transfers.name</field>

<field name="view_mode">tree,form</field>

<field name="help" type="html">

<p class="o_view_nocontent_smiling_face">

create your first transfer

</p>

</field>

</record>

<menuitem id ="transfers_root" name ="Transfers" sequence ="0" web_icon="transfers,static/description/icon.png" />

<menuitem id ="transfers_name" name ="Transfers_Name" parent="transfers_root" action="action_transfers"/>

</odoo>

Hi, Guna

It seems there is some issue with your Odoo. You can pull the latest patch from Odoo then check.

Hope that will fix your issues.

Issues related to that subject is already raised and closed on GITHUB.

https://github.com/odoo/odoo/issues/27580

https://github.com/odoo/odoo/issues/26060

https://github.com/odoo/odoo/commit/04369bab39a217126811c0b8c26bd40b68f547c5

Thanks,

Ashish Singh

Best Answer

Hi,

Make sure that you have imported the model(Transfers.name) in __init__.py file , if imported then check whether you have added the access rights for the model(Transfers.name) you are newly created.

In your record action_transfers your model is transfers.name and in the other record it is Transfers.name ,also check which one is the correct one.

Regards

Avatar
Discard
Author Best Answer

when iam trying to upgrade the module iam getting this error

Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 392, in _check_xml
    self.postprocess_and_fields(view.model, view_doc, view.id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 931, in postprocess_and_fields
    self.raise_view_error(_('Model not found: %(model)s') % dict(model=model), view_id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 592, in raise_view_error
    raise ValueError(message)
ValueError: Model not found: Transfers.name

Error context:
View `Money.Transfer.form`
[view_id: 385, xml_id: fetchmail.view_email_server_tree, model: Transfers.name, parent_id: n/a]

transfers.py:
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import models, fields, _



class Transfers(models.Model):
_name ="transfers.name"
_description ="Transfer Record"

transfers_Name = fields.Char(string="Name", required = True)
transfers_ISO = fields.Char(string="ISO")
transfers_amount = fields.Integer("Amount")
notes = fields.Text(string ="Notes")
image = fields.Binary(string ="Image")

transfers.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>


<record id="money_transfer" model="ir.ui.view">
<field name="name">Money.Transfer.form</field>
<field name="model">Transfers.name</field>
<field name="arch" type="xml">
<form string ="money_transfers">
<group>
<field name ="transfers_Name"/>
<field name ="transfers_ISO"/>
<field name ="transfers_amount"/>
<field name ="notes"/>
<field name ="image"/>
</group>
</form>
</field>
</record>


<record id="action_transfers" model="ir.actions.act_window">
<field name="name">Transfers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">transfers.name</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
create your first transfer
</p>
</field>
</record>


<menuitem id ="transfers_root" name ="Transfers" sequence ="0" web_icon="transfers,static/description/icon.png" />
<menuitem id ="transfers_name" name ="Transfers_Name" parent="transfers_root" action="action_transfers"/>


</odoo>


Avatar
Discard
Related Posts Replies Views Activity
4
May 24
10073
1
Apr 24
1563
0
Nov 23
525
1
Sep 23
567
2
Aug 23
2425