← Back to team overview

openerp-india team mailing list archive

[Bug 1073302] [NEW] framework must not accept xml-rpc to write into function fields

 

Public bug reported:

6.1 this statement "works"

reason: if a field becomes a stored function field (during upgrade,
module install ...) - any remote "already working" application writing
values using xml-rpc will continue to write and succeed without
notification that the values are NOT written  any more, because the
function fields gets updated and stored with the correct value.

after executing this statement the value of complete_name = "New CRM"
even though the application has written "100".

***************************** Test case ************************
import xmlrpclib

username = 'demo' #the user
pwd = 'demo'      #the password of the user
dbname = 'demo'    #the database

# Get the uid
sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
uid = sock_common.login(dbname, username, pwd)

#replace localhost with the address of the server
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')

crm = {
   'name': 'New CRM',
   'complete_name' : 100,
}

crm_id = sock.execute(dbname, uid, pwd, 'crm.case.section', 'create',
crm)

print crm_id
******************************

** Affects: openobject-server
     Importance: Undecided
         Status: New

** Description changed:

  6.1 this statement "works"
  
  reason: if a field becomes a stored function field (during upgrade,
  module install ...) - any remote "already working" application writing
  values using xml-rpc will continue to write and succeed without
  notification that the values are NOT written  any more, because the
  function fields gets updated and stored with the correct value.
  
  after executing this statement the value of complete_name = "New CRM"
  even though the application has written "100".
  
  ***************************** Test case ************************
  import xmlrpclib
  
- username = 'admin' #the user
- pwd = 'admincc5'      #the password of the user
- dbname = 'cc_20121021_1232'    #the database
+ username = 'demo' #the user
+ pwd = 'demo'      #the password of the user
+ dbname = 'demo'    #the database
  
  # Get the uid
  sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
  uid = sock_common.login(dbname, username, pwd)
  
  #replace localhost with the address of the server
  sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
  
  crm = {
-    'name': 'New CRM',
-    'complete_name' : 100,
+    'name': 'New CRM',
+    'complete_name' : 100,
  }
  
  crm_id = sock.execute(dbname, uid, pwd, 'crm.case.section', 'create',
  crm)
  
  print crm_id
  ******************************

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1073302

Title:
  framework must not accept xml-rpc to write into function fields

Status in OpenERP Server:
  New

Bug description:
  6.1 this statement "works"

  reason: if a field becomes a stored function field (during upgrade,
  module install ...) - any remote "already working" application writing
  values using xml-rpc will continue to write and succeed without
  notification that the values are NOT written  any more, because the
  function fields gets updated and stored with the correct value.

  after executing this statement the value of complete_name = "New CRM"
  even though the application has written "100".

  ***************************** Test case ************************
  import xmlrpclib

  username = 'demo' #the user
  pwd = 'demo'      #the password of the user
  dbname = 'demo'    #the database

  # Get the uid
  sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
  uid = sock_common.login(dbname, username, pwd)

  #replace localhost with the address of the server
  sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')

  crm = {
     'name': 'New CRM',
     'complete_name' : 100,
  }

  crm_id = sock.execute(dbname, uid, pwd, 'crm.case.section', 'create',
  crm)

  print crm_id
  ******************************

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1073302/+subscriptions


Follow ups

References