Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openobject-client-web/6.0-opw-383521-msh into
lp:openobject-client-web.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-383521-msh/+merge/92464
Hello,
Fixed the issue of context which is forgotten in read method which is not
forgotten due to which language specific read data are not coming while write.
Currently what web-client 6.0 is do when you call write, it will call read
first and map the data of read with form data and if it finds any field change
then it will put it in modified dictionary and send it while calling write.
To generate this issue you need two languages, here say for e.g. English and
French BE.
Demo :- Create one product named test_eng, here product name is translatable so
change the product name for french to test_fr, now change language to french
and go to this product which we have created recently, you will see product
name is test_fr, upto this it is ok, now try to modify this name to test_eng
and save it, it will not be changed.
That means it not allows to change you the same name as english name.
Reason :- Before write we calls read in web to check data, but here we have
forgot context in read method so the read will give default language data which
is english and in english we have set product name as test_eng and also we
modify the product to test_eng, so both the string are equal so web will
consider it as a no change.
Hence changed the read call and added a context.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-383521-msh/+merge/92464
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-opw-383521-msh.
=== modified file 'addons/openerp/controllers/form.py'
--- addons/openerp/controllers/form.py 2011-11-23 08:38:45 +0000
+++ addons/openerp/controllers/form.py 2012-02-10 13:12:19 +0000
@@ -404,7 +404,8 @@
params.ids = (params.ids or []) + [params.id]
params.count += 1
else:
- original_data = Model.read(params.id, data.keys())
+ ctx = dict((params.context or {}), **rpc.session.context)
+ original_data = Model.read(params.id, data.keys(), ctx)
modified = {}
if original_data and isinstance(original_data, dict):
_______________________________________________
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