Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openobject-client-web/6.0-opw-17632-msh into
lp:openobject-client-web/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-17632-msh/+merge/77880
Hello,
Fixed the issue of thunderbird plugin which was unable to download due to
revision 4647.
Which was coded to remove bug of knowledge -> document saving.
Here changed the code accordingly to remove both the issue.
If we'll remove revision 4647 then we will not able to save the document at the
time of edit and due to that revision any plugin was not able to download.
So this code will solve both the issue.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-17632-msh/+merge/77880
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-opw-17632-msh.
=== modified file 'addons/openerp/controllers/form.py'
--- addons/openerp/controllers/form.py 2011-09-02 10:41:16 +0000
+++ addons/openerp/controllers/form.py 2011-10-03 09:27:34 +0000
@@ -666,8 +666,6 @@
proxy = rpc.RPCProxy(params.model)
res = proxy.read([params.id],[params.field], rpc.session.context)
return base64.decodestring(res[0][params.field])
- elif params.filename:
- return base64.decodestring(data[params.filename])
else:
return base64.decodestring(data[params.field])
=== modified file 'addons/openerp/static/javascript/binary.js'
--- addons/openerp/static/javascript/binary.js 2011-09-02 10:41:16 +0000
+++ addons/openerp/static/javascript/binary.js 2011-10-03 09:27:34 +0000
@@ -37,7 +37,6 @@
submit_form(openobject.http.getURL(act, {
_terp_field: name,
- _terp_filename: filename,
_terp_model: openobject.dom.get(prefix + '_terp_model').value,
_terp_id: openobject.dom.get(prefix + '_terp_id').value
}), undefined, '_blank');
=== modified file 'addons/openerp/widgets/form/_binary.py'
--- addons/openerp/widgets/form/_binary.py 2011-05-03 12:53:07 +0000
+++ addons/openerp/widgets/form/_binary.py 2011-10-03 09:27:34 +0000
@@ -20,6 +20,7 @@
###############################################################################
import random, time
+import binascii
from openobject import tools
from openerp import utils
@@ -40,10 +41,11 @@
class Binary(TinyInputWidget):
template = "/openerp/widgets/form/templates/binary.mako"
- params = ["name", "text", "readonly", "filename", "bin_data", 'value_bin_size']
+ params = ["name", "text", "readonly", "filename", "bin_data", 'value_bin_size', 'val']
text = None
file_upload = True
+ val = True
def __init__(self, **attrs):
super(Binary, self).__init__(**attrs)
@@ -56,6 +58,10 @@
def set_value(self, value):
#XXX: server bug work-arround
+ try:
+ binascii.a2b_base64(value)
+ except:
+ self.val = False
if self.value_bin_size:
self.text = value
return
=== modified file 'addons/openerp/widgets/form/templates/binary.mako'
--- addons/openerp/widgets/form/templates/binary.mako 2011-06-29 05:19:57 +0000
+++ addons/openerp/widgets/form/templates/binary.mako 2011-10-03 09:27:34 +0000
@@ -21,8 +21,8 @@
</div>
<div id="${name}_binary_buttons" class="binary_buttons">
<input type="text" value="${value or text or ''}" readonly="readonly"/>
- %if value:
- <input type="hidden" name="${name}" value="${value}"></input>
+ %if val:
+ <input type="hidden" name="${name}" value="${text or ''}"></input>
% endif
% if text:
<a class="button-a" href="javascript: void(0)" onclick="save_binary_data('${name}', '${filename}')">${_("Save As")}</a>
_______________________________________________
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