콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
13963 화면

Hello to all , I have been working on a module in OpenERP-7 and I have come across an Integrity error which is occurring on clicking the button. My module was working fine untill yesterday but then I made some changes in the xml view like inheriting some fields from product.product class.The xml view is working ok but the button function is giving me integrity error just after I included the inherited fields into my module.

The two buttons in my xml code are associated to two functions . One is returning the form view of the current product and other is returning the default product form for creating new product.The buttons on clicking are giving following error :

Integrity Error The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set [object with reference: name - name]

When I try to add a new button just to show a message, I still get the same integrity error.I think it is because of that inherited fields or may be something else.Please guide me to the direction so that I may be able to fix this.

Thanks n Regards

아바타
취소

idem for me now!

베스트 답변

2015-11-26 05:15:05,503 2525 ERROR openerp.sql_db: bad query: INSERT INTO "base_config_settings" ("id", "alias_domain", "module_google_drive", "module_base_import", "auth_signup_uninvited", "module_share", "module_google_calendar", "module_portal", "font", "module_auth_oauth", "auth_signup_reset_password", "module_multi_company", "auth_signup_template_user_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('base_config_settings_id_seq'), 'localhost', false, true, false, true, false, true, NULL, false, true, false, 4, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id

Traceback (most recent call last):

File "/home/workspace/odoo/openerp/sql_db.py", line 234, in execute

res = self._obj.execute(query, params)

IntegrityError: insert or update on table "base_config_settings" violates foreign key constraint "base_config_settings_auth_signup_template_user_id_fkey"

DETAIL: Key (auth_signup_template_user_id)=(4) is not present in table "res_users".

2015-11-26 05:15:05,504 2525 ERROR openerp.http: Exception during JSON request handling.

Traceback (most recent call last):

File "/home/workspace/odoo/openerp/http.py", line 526, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/workspace/odoo/openerp/http.py", line 563, in dispatch

result = self._call_function(**self.params)

File "/home/workspace/odoo/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/workspace/odoo/openerp/service/model.py", line 149, in wrapper

raise openerp.osv.orm.except_orm(_('Integrity Error'), msg)

except_orm: ('Integrity Error', 'The operation cannot be completed, probably due to the following:\n- deletion: you may be trying to delete a record while other records still reference it\n- creation/update: a mandatory field is not correctly set\n\n[object with reference: Users - res.users]')


I'm stuck to resolve it since two days. Help me to resolve this issue.

아바타
취소
베스트 답변

It is due to relational field. Maybe you have many2one or one2many relation which has a required field

아바타
취소
베스트 답변

I think one mandatory field you have been not set correctly and i.e. name field in your model.

or otherwise show me your code.

아바타
취소
관련 게시물 답글 화면 활동
2
3월 15
4615
2
12월 23
12611
3
7월 22
22919
2
6월 21
18426
0
9월 20
3663