hello Sylvain Calador,

we appreciate your efforts ! 
Looking at the patch I would just make few notes.
first :you forgot to remove the line no 346 "edited_model.modified = True", 
which indeed will always make the model modified.
secondly: you read the previous & current value of the model through 
model.get() but this will return you the data in the format that the server 
expects and not the client. I think you should use  like
for mod, field in model.mgroup.mfields.iteritems():
     field.get_client()

this will give you the values from the client. I think this is the
reason for the following crash.

TEST:

I applied your patch then opened a sale order double clicked the order
line and changed the quantity from 1 to 4. then I clicked cancel. it
crashed with the traceback

xmlrpclib.Fault: <Fault unhashable type: 'list': 'Traceback (most recent
call last):\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/netsvc.py", line
410, in dispatch\n    result =
ExportService.getService(service_name).dispatch(method, auth, params)\n
File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/service/web_services.py",
line 598, in dispatch\n    res = fn(db, uid, *params)\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/osv/osv.py", line
122, in wrapper\n    return f(self, dbname, *args, **kwargs)\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/osv/osv.py", line
176, in execute\n    res = self.execute_cr(cr, uid, obj, method, *args,
**kw)\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/osv/osv.py", line
167, in execute_cr\n    return getattr(object, method)(cr, uid, *args,
**kw)\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/osv/orm.py", line
2938, in read\n    result = self._read_flat(cr, user, select, fields,
context, load)\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/osv/orm.py", line
2989, in _read_flat\n    for sub_ids in
cr.split_for_in_conditions(ids):\n  File
"/home/nch/workspace/OpenERP2011/Trunk/server/openerp/sql_db.py", line
163, in split_for_in_conditions\n    return
tools.misc.split_every(self.IN_MAX, set(ids))\nTypeError: unhashable
type: \'list\'\n'>

Thanks !

-- 
You received this bug notification because you are a member of OpenERP
sa GTK client R&D, which is a bug assignee.
https://bugs.launchpad.net/bugs/750465

Title:
  cancel one2many edit dialog, asks user for saving

Status in OpenERP GTK Client:
  Confirmed

Bug description:
  Hi,

  From an already saved record containing a one2many widget,
  when the user open a line in the one2many widget and just clicks cancel or 
close,
  and then try to close the parent record (by cliking next record's button for 
exemple),
  the user is asked for saving the record ("This record has been modified, do 
you want to save it ?")

  The expected behavior is not to ask when the record is not modified.

  Find a patch attached, which works for me, but need review.

  Thanks,

  Sylvain

  OpenERP - GTK Client - v6.0.2
  revno: 1827

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to