Invalid model name in action definition

Asked by Hitesh Ambaliya

1) I am using OpenERP 6.0.3 on Ubuntu 10.04 (debian)

I have problem when creating one module
first i have created one class and xml file also for view, action and menu records, that was successfully working.

But now i have added one another class, and add code for view, action , menu but it give error as below...

[2012-06-23 10:24:03,810][Demo_6_0] ERROR:tools.convert.xml_import:Parse error in /home/merlin/openerp_stable/6.0/addons/openacademy/view/openacademy.xml:84:
<record model="ir.actions.act_window" id="mytest_list_action">
            <field name="name">MyTest</field>
            <field name="res_model">example.mytest</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
Traceback (most recent call last):
  File "/home/merlin/openerp_stable/6.0/server/bin/tools/convert.py", line 865, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/merlin/openerp_stable/6.0/server/bin/tools/convert.py", line 832, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/home/merlin/openerp_stable/6.0/server/bin/addons/base/ir/ir_model.py", line 691, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/merlin/openerp_stable/6.0/server/bin/osv/orm.py", line 3690, in create
    self._validate(cr, user, [id_new], context)
  File "/home/merlin/openerp_stable/6.0/server/bin/osv/orm.py", line 946, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', 'Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition.')

=> I have checked names of module in .py file and in .xml file but error not still solve also after restart server
-----------------
2) Is there any of the condition to write menu record after action record for a module or inverse or can be write in any of sequence means just existence of code for a module required in any of the sequence.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Hitesh Ambaliya
Solved:
Last query:
Last reply:
Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#1

Hi Hitesh Ambaliya,

The error may be caused by un-updated database. You will have to update
the database before running OpenERP server for anything related with
database modification. In this case, you may issue the below command to
start the OpenERP server:

openerp-server -dYourDB -rDB_USER -wDB_PASS -uYourModuleName
<http://www.openerp.cn>

*Tony Gu* --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213 Skype: digitalsatori
http://www.openerp.cn
*OpenERP Official Partner in China*

On 2012年06月23日 14:15, Hitesh Ambaliya wrote:
> New question #201237 on OpenERP Server:
> https://answers.launchpad.net/openobject-server/+question/201237
>
> 1) I am using OpenERP 6.0.3 on Ubuntu 10.04 (debian)
>
> I have problem when creating one module
> first i have created one class and xml file also for view, action and menu records, that was successfully working.
>
> But now i have added one another class, and add code for view, action , menu but it give error as below...
>
> [2012-06-23 10:24:03,810][Demo_6_0] ERROR:tools.convert.xml_import:Parse error in /home/merlin/openerp_stable/6.0/addons/openacademy/view/openacademy.xml:84:
> <record model="ir.actions.act_window" id="mytest_list_action">
> <field name="name">MyTest</field>
> <field name="res_model">example.mytest</field>
> <field name="view_type">form</field>
> <field name="view_mode">tree,form</field>
> </record>
> Traceback (most recent call last):
> File "/home/merlin/openerp_stable/6.0/server/bin/tools/convert.py", line 865, in parse
> self._tags[rec.tag](self.cr, rec, n)
> File "/home/merlin/openerp_stable/6.0/server/bin/tools/convert.py", line 832, in _tag_record
> id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
> File "/home/merlin/openerp_stable/6.0/server/bin/addons/base/ir/ir_model.py", line 691, in _update
> res_id = model_obj.create(cr, uid, values, context=context)
> File "/home/merlin/openerp_stable/6.0/server/bin/osv/orm.py", line 3690, in create
> self._validate(cr, user, [id_new], context)
> File "/home/merlin/openerp_stable/6.0/server/bin/osv/orm.py", line 946, in _validate
> raise except_orm('ValidateError', '\n'.join(error_msgs))
> except_orm: ('ValidateError', 'Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition.')
>
> => I have checked names of module in .py file and in .xml file but error not still solve also after restart server
> -----------------
> 2) Is there any of the condition to write menu record after action record for a module or inverse or can be write in any of sequence means just existence of code for a module required in any of the sequence.
>
>
>
>

Revision history for this message
Hitesh Ambaliya (hitesh-ambaliya) said :
#2

Thanx for help
I got error when pass above command but after some try to solve problem, error was solved

Thanx to digitalsatori

Revision history for this message
Hitesh Ambaliya (hitesh-ambaliya) said :
#3

Thanx for help
I got error when pass above command but after some try to solve problem, error was solved

Thanx to digitalsatori

Revision history for this message
santosh singh mehta (santosh.snts) said :
#4

how it solve https://launchpad.net/~hitesh-ambaliya same issue here?