[sale] integrity error reference name - name

Bug #673525 reported by Domenico Colucci
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
In Progress
High
OpenERP R&D Addons Team 3

Bug Description

Version: trunk
Addon: sale
Step: installation
Language: German

Traceback (most recent call last):
  File "d:\openerp\win-installer-trunk\trunk\client\bin\widget\view\form_gtk\parser.py", line 123, in button_clicked
    model.get_button_action(self.form.screen, id, self.attrs)
  File "D:\openerp\win-installer-trunk\trunk\client\bin\widget\model\record.py", line 372, in get_button_action
    self.resource,attrs['name'], [id], context)
  File "D:\openerp\win-installer-trunk\trunk\client\bin\rpc.py", line 185, in rpc_exec_auth
    return sock.exec_auth(method, *args)
  File "D:\openerp\win-installer-trunk\trunk\client\bin\rpc.py", line 119, in exec_auth
    res = self.execute(method, self._uid, self._passwd, *args)
  File "D:\openerp\win-installer-trunk\trunk\client\bin\rpc.py", line 136, in execute
    raise e
tiny_socket.Myexception: ('warning -- Integrity Error\n\nThe 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: name - name]', 'Traceb
ack (most recent call last):\n File "D:\\openerp\\win-installer-trunk\\trunk\\server\\bin\\netsvc.py", line 489, in dispatch\n result = ExportService.getService(service_name).dispatch(method, auth, params)\n File "D:\\openerp\\win-installer-trunk\\trunk\\server\\bin\\service\\web_services.py", line 586, in dispatc
h\n res = fn(db, uid, *params)\n File "D:\\openerp\\win-installer-trunk\\trunk\\server\\bin\\osv\\osv.py", line 88, in wrapper\n self.abortResponse(1, _(\'Integrity Error\'), \'warning\', msg)\n File "D:\\openerp\\win-installer-trunk\\trunk\\server\\bin\\netsvc.py", line 70, in abortResponse\n raise Exceptio
n("%s -- %s\\n\\n%s"%(origin, description, details))\nException: warning -- Integrity Error\n\nThe 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: name - name]\n')

Revision history for this message
Domenico Colucci (domenico-colucci) wrote :
Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

Hi,

I have the same error with HR module :

Traceback (most recent call last):
  File "/mnt/partition/OpenERP/trunk/server/bin/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint

[2010-11-10 15:07:45,799][hr_test2] ERROR:tools.convert.xml_import:Parse error in /mnt/partition/OpenERP/trunk/addons/hr/security/hr_security.xml:12:
<record id="base.user_demo" model="res.users">
            <field name="groups_id" eval="[(4, ref('base.group_hr_user'))]"/>
     </record>
MODEL 29 34 name

Revision history for this message
Lorenzo Battistini (elbati) wrote :

openobject-server revno 3003
openobject-addons revno 3907

Same error here. openerp-server log while installing 'sale':

[2010-11-11 09:29:25,572][sale6] INFO:init:module sale: loading security/sale_security.xml
[2010-11-11 09:29:25,646][sale6] ERROR:db.cursor:bad query: insert into "res_users" (id,"menu_id","address_id","context_lang","company_id","menu_tips","active","password",create_uid,create_date) values (3,1,NULL,E'en_US',1,E'True',E'True',E'',1,now())
Traceback (most recent call last):
  File "/home/elbati/workspace/openerp/server/openobject-server/bin/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint

[2010-11-11 09:29:25,647][sale6] ERROR:tools.convert.xml_import:Parse error in /home/elbati/workspace/openerp/addons/openobject-addons/sale/security/sale_security.xml:20:
<record id="base.user_demo" model="res.users">
            <field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
        </record>
MODEL 29 34 name

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Things seem to work again by reverting this:

        revno: 3164.149.1
        committer: vth<email address hidden>
        branch nick: trunk-dev-addons3-vth2
        timestamp: Mon 2010-11-01 18:16:06 +0530
        message:
          [IMP] account,hr,sale,point_of_sale,event: give user role to the demo user

Revision history for this message
idilchev (ivan-dilchev) wrote :

ubuntu 10.04
postgresql-8.4.5

Tree is up to date at revision 3003 of branch /opt/openerp/openerp-server
...........
Tree is up to date at revision 3907 of branch /opt/openerp/addons
..........

.....
[2010-11-11 17:35:00,328][i2] INFO:init:module sale: loading wizard/sale_make_invoice_advance.xml
[2010-11-11 17:35:00,395][i2] INFO:init:module sale: loading wizard/sale_line_invoice.xml
[2010-11-11 17:35:00,451][i2] INFO:init:module sale: loading wizard/sale_make_invoice.xml
2010-11-11 17:35:00,505][i2] INFO:init:module sale: loading security/sale_security.xml
[2010-11-11 17:35:00,543][i2] ERROR:db.cursor:bad query: insert into "res_users" (id,"menu_id","address_id","context_lang","company_id","menu_tips","active","password",create_uid,create_date) values (4,1,NULL,E'en_US',1,E'True',E'True',E'',1,now())
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint

[2010-11-11 17:35:00,544][i2] ERROR:tools.convert.xml_import:Parse error in /usr/local/lib/python2.6/dist-packages/openerp-server/addons/sale/security/sale_security.xml:20:
<record id="base.user_demo" model="res.users">
            <field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
        </record>

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello,

I have checked this with the latest code revision from following link:
https://code.launchpad.net/~openerp/openobject-addons/trunk
would you please refer the above link and check again.

Thanks.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Just tried with current trunk.
Event with account, same error:

[2010-11-12 11:01:04,389][l10n6] INFO:init:module account_accountant: loading security/account_security.xml
[2010-11-12 11:01:04,469][l10n6] ERROR:db.cursor:bad query: insert into "res_users" (id,"menu_id","address_id","context_lang","company_id","menu_tips","active","password",create_uid,create_date) values (3,1,NULL,E'en_US',1,E'True',E'True',E'',1,now())
Traceback (most recent call last):
  File "/home/elbati/workspace/openerp/server/openobject-server/bin/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "name" violates not-null constraint

[2010-11-12 11:01:04,470][l10n6] ERROR:tools.convert.xml_import:Parse error in /home/elbati/workspace/openerp/addons/openobject-addons/account_accountant/security/account_security.xml:9:
<record id="base.user_demo" model="res.users">
            <field name="groups_id" eval="[(4, ref('account.group_account_user'))]"/>
        </record>
MODEL 29 34 name

What is the purpose of this commit
http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-dev-addons3/revision/4563#sale/security/sale_security.xml ?
In a non-demo environment, the 'base.user_demo' does not exist, hence the error

Changed in openobject-addons:
status: Invalid → New
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Not account, however account_accountant :-)

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello,

I am confirming this issue when creating database without demo data, The installation will fail.

Thanks.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → High
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
milestone: none → 6.0-rc2
Revision history for this message
cubells (cubells) wrote :
Download full text (3.6 KiB)

opererp-server: 6.0.4
openerp-client: 6.0.4
ubuntu: 12.4
firefox: 14.0.1

>>> import xmlrpclib
>>> user = "cubells"
>>> passwd = "cubellspw"
>>> db = "cubellsdb"
>>> sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
>>> uid = sock_common.login(db, user, passwd)
>>> sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
>>> product_template = {
... 'name': 'Cheese burger',
... 'supply_method': 'buy',
... 'list_price': 4.5,
... 'purchase_ok' : True,
... 'type' : 'product',
... 'procure_method': 'make_to_stock',
... 'sale_ok': True,
... 'uom_id': 1,
... 'company_id': 1,
... 'uom_po_id': 1,
... 'categ_id': 1,
... 'rental': False,
... }
>>> product_id = sock.execute(db, uid, passwd, 'product.template', 'create', product_template)
>>> product_product = {
... 'product_template_id': product_id,
... 'default_code': 123456,
... 'name_template': 'Cheese burger',
... 'active': True,
... }
>>> product_id = sock.execute(db, uid, passwd, 'product.product', 'create', product_product)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault warning -- 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]: 'Traceback (most recent call last):\n File "/usr/local/lib/python2.7/dist-packages/openerp-server/netsvc.py", line 489, in dispatch\n result = ExportService.getService(service_name).dispatch(method, auth, params)\n File "/usr/local/lib/python2.7/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch\n res = fn(db, uid, *params)\n File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 154, in wrapper\n self.abortResponse(1, _(\'Integrity Error\'), \'warning\', msg)\n File "/usr/local/lib/python2.7/dist-packages/openerp-server/netsvc.py", line 70, in abortResponse\n raise Exception("%s -- %s\\n\\n%s"%(origin, description, details))\nException: warning -- Integrity Error\n\nThe 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: name - name]\n'>
>>>

Openerp server log says:

ERROR:db.cursor:bad query: insert into "product_template" (id,"supply_method","list_price","standard_price","mes_type","uom_id","cost_meth...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.