How to remove :Error occurred while validating the field(s)

Asked by shanky

Hi all
I can't import module and installation do not complte due to the following warning message

Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition.

how to resolve it anyone help me.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
shanky
Solved:
Last query:
Last reply:
Revision history for this message
Naresh(OpenERP) (nch-openerp) said :
#1

Hi Shankar ,

The error is self descriptive and give you the hint too "Invalid model name in the action definition." Check the view of your module and the action you defined . According to the error you have not written correct model ame in the action.

I hope you better read the Doc .It will help you a lot.

http://doc.openerp.com/

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#2

Hi nch,

My problem get solved and module work fine,Today I delete all databases on the sever. Start with new database and module work fine.

Revision history for this message
mm alam (masoom-alam) said :
#3

This error is a quite tricky one.

Here is my view file code.

<record model="ir.ui.view" id="view_academicyear">
            <field name="name">academicyear.main.form</field>
            <field name="model">academicyear.main</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Category of ideas">
                      <field name="name" select="1"/>

                </form>
            </field>
        </record>

 <record model="ir.actions.act_window" id="academicyear_action">
         <field name="name">academicyears.mainaction</field>
  <field name="res_model">academicyear.main</field>
          <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
  </record>

 <menuitem name="Academic Year" parent="menu_config" id="menu_academicyear" action="academicyear_action"/>

and corresponding python file is as follows:-

class academicyear_main(osv.osv):
    _name = "academicyear.main"
    _description = "academicyear"
    _columns = {
        'name': fields.char('Academic Year', size=64, required=True),
    }
academicyear_main()

But i am still getting the same error that:

"Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition."

Please help.

Revision history for this message
Fernando Lopez (kyon) said :
#4

i had the same mistake, and it was because my ref was pointing to tree view, but my start view was the form one, i leave here my code:
        <record id="action_employee_company_form" model="ir.actions.act_window">
            <field name="name">Companies</field>
            <field name="res_model">employee.company</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
     <field name="view_mode">tree,form</field> ///here and
            <field name="view_id" ref="view_employee_company_tree"/> ///here
     <field name="help">Create and manage your employees' companies from here</field>
        </record>
Don't know if it's the same problem, hope it helps you or someone else.