Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

unable to Inherit HR.Employee [Closed]

By
priyankahdp
on 3/18/13, 1:10 AM 2,566 views

The Question has been closed

by
priyankahdp
on 04/20/2013 03:23:00

please show me where is my mistaken point ? i need to add new field called kanganyname (manager name).but its give me a error

here is my view.xml

    <record model="ir.ui.view" id="namelist_dailyupdate">
        <field name="name">checkroll.daily.update.form</field>
        <field name="model">checkroll.daily.update</field>
        <field name="inherit_id" ref="hr.view_employee_form" />
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="daily_update">
                <field name="kanganyname" />
            </form>
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_inherit_ex">
        <field name="name">checkroll.daily.update.form</field>
        <field name="model">checkroll.daily.update</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
    </record>

here is my model class

class dailyupdate(osv.osv):
    _name = "checkroll.daily.update"
    _inherit = "hr.employee"
    _description = "This table is for daily update"
    _columns = {
        'kanganyname': fields.char('Kangany Name', size=256, required=True)
    }

dailyupdate()

here is my error

Traceback (most recent call last):
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "res_model" violates not-null constraint

2013-03-18 04:10:16,830 4709 ERROR OpenERP_DB openerp.tools.convert: Parse error in /home/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/checkroll/checkroll_view.xml:179: 
<record model="ir.actions.act_window" id="action_inherit_ex">
            <field name="name">checkroll.daily.update.form</field>
            <field name="model">checkroll.daily.update</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
        </record>
Traceback (most recent call last):
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/tools/convert.py", line 814, 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/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/base/ir/ir_model.py", line 964, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/osv/orm.py", line 4434, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "res_model" violates not-null constraint

2013-03-18 04:10:16,835 4709 ERROR OpenERP_DB openerp.netsvc: null value in column "res_model" violates not-null constraint
Traceback (most recent call last):
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/service/web_services.py", line 425, in dispatch
    return fn(*params)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/service/web_services.py", line 436, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/pooler.py", line 49, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/registry.py", line 192, in get
    update_module)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 344, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 259, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 190, in load_module_graph
    load_update_xml(module_name, idref, mode)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 74, in <lambda>
    load_update_xml = lambda *args: _load_data(cr, *args, kind='update_xml')
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 127, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/tools/convert.py", line 814, 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/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/base/ir/ir_model.py", line 964, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/osv/orm.py", line 4434, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "res_model" violates not-null constraint

2013-03-18 04:10:16,847 4709 INFO OpenERP_DB werkzeug: 127.0.0.1 - - [18/Mar/2013 04:10:16] "POST /web/session/authenticate HTTP/1.1" 200 -
1
joshuajan
On 3/18/13, 3:10 AM

follow the error message:

IntegrityError: null value in column "res_model" violates not-null constraint

You need to add res_model to action_inherit_ex

<field name="res_model">checkroll.daily.update</field>
  • res_model is the name of the object on which the action operates.

More detail you can found in the document

thanks Joshuajan..please tell me what is the 'res_model' means.?

priyankahdp
on 3/18/13, 3:13 AM
0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 3/18/13, 7:53 AM

Hello,

You would need to use 'res_model' instead of 'model' in ir.actions.act_window record.

Example: <field name="res_model">checkroll.daily.update</field>

Thanks, Serpent Consulting Services

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/18/13, 1:10 AM
Seen: 2566 times
Last updated: 3/16/15, 8:10 AM