Odoo Help


ProgrammingError: constraint foreign key relation does not exist

on 4/16/14, 8:54 AM 2,764 views

When i am upgrade my crm module it shows following error and does not login admin.

ProgrammingError: constraint "portal_crm_crm_contact_us_b_unit_fkey" of relation "portal_crm_crm_contact_us" does not exist

Can any one help me out......

Rafael Reuber
On 4/16/14, 11:38 AM

Start the openerp-server updating your crm módule:

sh openerp-server -d yourdbname -u all

This command will update all your database structure. You can also only update especific module, for example:

sh openerp-server -d yourdbname -u my_crm

Thank you Rafael Reuber i will try these commands...

on 4/17/14, 3:32 AM

Mr.Rafael Reuber when try this sh openerp-server -d yourdbname -u crm it shows openerp-server: 2: openerp-server: import: not found openerp-server: 5: openerp-server: Syntax error: Bad function name

on 4/17/14, 4:07 AM

Med Said BARA

--Med Said BARA--

| 5 5 7
--Med Said BARA--
Med Said BARA
On 4/16/14, 1:42 PM

You probably deleted a module or a record related to b_unit.

What's b_unit ?

b_unit is a field created by me in crm.py also in crm_lead.py

on 4/17/14, 3:33 AM

How did you create it - Paste your code. Did you updated your OpenERP instance recently ?

Med Said BARA
on 4/17/14, 8:42 AM

I created as a field in crm_lead.py file.I updated OpenERP instance recently 'B_unit':fields.many2one('crm.case.businessunit','Business Unit',required=True),

on 4/18/14, 3:54 AM

When you update, the core file and the addons files are updated (including the crm module), this means that probably the changes you made in crm_lead.py are lost.

Med Said BARA
on 4/18/14, 7:56 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/16/14, 8:54 AM
Seen: 2764 times
Last updated: 3/16/15, 8:10 AM