简体   繁体   中英

res_model not valid openErp 6.1

Having this py file: from osv import osv, fields

class my_class(osv.osv_memory):
 _name = 'my.class'
  _columns = {
   'column1': fields.integer('Column1:'),
   'column2': fields.integer('Column2:'),
 } 
my_class()

a viue like:

  <record model="ir.ui.view" id="view_my_class">
    <field name="name">my.class.form</field>
    <field name="model">my.class</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
     <field name="Column1"/>
     <field name="Column2"/>
    </field>
  </record>

and an action view inside xml with this format:

  <record model="ir.actions.act_window" id="action_my_action'">
    <field name="name">Stuff,,,</field>
    <field name="res_model">my.class</field>
    <field name="view_type">form</field>
    <field name="view_mode">form</field>
    <field name="view_id" ref="view_my_class"/>
    <field name="target">new</field>
  </record>  

It appears this errror:

Validate Error An error has occurred while the field (s) res_model, src_model validated: Invalid model name in the action definition.

Why?

PD: its a wizard part of my own module.

main init imports main addon file, wizard init imports its correct file, what else you need? – Mark Dec 12 '15 at 11:30

4 years later... do you check your main init .py for wizard imports? anyway, take it as a state of mind :) It has taken me years too...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM