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.

0

Integrity Error in open erp?

By
divya
on 7/8/14, 2:51 AM 984 views

Integrity Error is raising while installing new module

duplicate key value violates unique constraint "ir_module_module_pkey"
DETAIL: Key (id)=(247) already exists.

code:

  <record id="res_partner_crm_sys_info2" model="ir.ui.view">
        <field name="name">res.partner.sys.info</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="crm_sys_info.res_partner_sys_info" />
        <field name="priority" eval="20"/>
        <field name="arch" type="xml">
  
      <field name="db_server" attrs="{'readonly': [('is_company','=', False)]}" context="{'db_server':db_server}" position="replace">
              <field name="db_server" context="{'db_server':db_server}" />
      </field>      
     
    </field>
 </record>

 

In py file:

class res_partner(osv.osv):
    _inherit = 'res.partner'

    _columns = {
        'db_server': fields.many2one('sys.info.db1','Database server'),
    }
res_partner()

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 7/8/14, 3:26 AM

Most likely you meant the other inherit function, also add this rule:

_name = 'res.partner' right above the _inherit.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

1 follower(s)

Stats

Asked: 7/8/14, 2:51 AM
Seen: 984 times
Last updated: 3/16/15, 8:10 AM