Naresh(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/trunk-bug-787840-nch into 
lp:openobject-client.

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)
Related bugs:
  Bug #787840 in OpenERP GTK Client: "No Excel export when lang not en_US"
  https://bugs.launchpad.net/openobject-client/+bug/787840

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-787840-nch/+merge/68074
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-787840-nch/+merge/68074
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/trunk-bug-787840-nch.
=== modified file 'bin/modules/gui/window/win_export.py'
--- bin/modules/gui/window/win_export.py	2011-01-25 10:26:37 +0000
+++ bin/modules/gui/window/win_export.py	2011-07-15 11:11:31 +0000
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
 #
@@ -15,7 +15,7 @@
 #    GNU Affero General Public License for more details.
 #
 #    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
 
@@ -105,7 +105,7 @@
             common.error(_('Error Opening Excel !'),'')
 
 def datas_read(ids, model, fields, fields_view, prefix='', context=None):
-    ctx = context.copy()    
+    ctx = context.copy()
     ctx.update(rpc.session.context)
     datas = rpc.session.rpc_exec_auth('/object', 'execute', model, 'export_data', ids, fields, ctx)
     return datas
@@ -161,11 +161,17 @@
         self.view1.show_all()
         self.view2.show_all()
 
+        hbox = self.glade.get_widget('hbox55')
+        self.wid_action = gtk.combo_box_new_text()
+        self.wid_action.append_text(_('Open in Excel'))
+        self.wid_action.append_text(_('Save as CSV'))
+        hbox.pack_start(self.wid_action)
+        hbox.reorder_child(self.wid_action, 0)
+        hbox.show_all()
+        action = self.wid_action.set_active(os.name != 'nt')
 
-        self.wid_action = self.glade.get_widget('win_saveas_combo')
         self.wid_write_field_names = self.glade.get_widget('add_field_names_cb')
-        action = self.wid_action.set_active(os.name!='nt')
-        
+
         if os.name != 'nt':
             self.wid_action.remove_text(0)
         else:
@@ -205,7 +211,7 @@
         import_comp = self.wid_import_compatible.get_active()
         fields = fields.copy()
         fields.update({'id':{'string':_('ID')}})
-        fields.update({'.id':{'string':_('Database ID')}}) 
+        fields.update({'.id':{'string':_('Database ID')}})
 
         fields_order = fields.keys()
         fields_order.sort(lambda x,y: -cmp(fields[x].get('string', ''), fields[y].get('string', '')))
@@ -219,7 +225,7 @@
             self.fields_data[prefix_node+field] = fields[field]
             if prefix_node:
                 self.fields_data[prefix_node + field]['string'] = '%s%s' % (prefix_value, self.fields_data[prefix_node + field]['string'])
-            st_name = fields[field]['string'] or field 
+            st_name = fields[field]['string'] or field
             node = self.model1.insert(prefix, 0, [st_name, prefix_node+field, (fields[field].get('required', False) and '#ddddff') or 'white'])
             self.fields[prefix_node+field] = (st_name, fields[field].get('relation', False))
             if fields[field].get('relation', False) and level>0:
@@ -235,7 +241,7 @@
     def del_export_list_key(self,widget, event, *args):
         if event.keyval==gtk.keysyms.Delete:
             self.del_selected_export_list()
-    
+
     def del_export_list_btn(self, widget=None):
         self.del_selected_export_list()
 
@@ -293,7 +299,7 @@
 
     def sig_unsel_all(self, widget=None):
         self.model2.clear()
-    
+
     def fill_predefwin(self):
         self.predef_model = gtk.ListStore(gobject.TYPE_PYOBJECT, gobject.TYPE_STRING, gobject.TYPE_STRING)
         ir_export = rpc.RPCProxy('ir.exports')
@@ -310,7 +316,7 @@
     def add_predef(self, button):
         name = common.ask(_('What is the name of this export ?'))
         if not name:
-            return 
+            return
         ir_export = rpc.RPCProxy('ir.exports')
         iter = self.model2.get_iter_root()
         fields = []
@@ -320,7 +326,7 @@
             iter = self.model2.iter_next(iter)
         ir_export.create({'name' : name, 'resource' : self.model, 'export_fields' : [(0, 0, {'name' : f}) for f in fields]})
         self.predef_model.append((fields, name, ','.join([self.fields_data[f]['string'] for f in fields])))
-    
+
     def sel_predef(self, treeview, path, column):
         self.model2.clear()
         for field in self.predef_model[path[0]][0]:
@@ -347,7 +353,7 @@
             result = result.get('datas',[])
             if import_comp:
                 fields2 = fields
-            if self.wid_action.get_active_text() == "Open in Excel":
+            if not action:
                 open_excel(fields2, result)
             else:
                 fname = common.file_selection(_('Save As...'),

=== modified file 'bin/openerp.glade'
--- bin/openerp.glade	2011-02-09 05:53:41 +0000
+++ bin/openerp.glade	2011-07-15 11:11:31 +0000
@@ -3092,13 +3092,6 @@
                     <property name="border_width">2</property>
                     <property name="spacing">2</property>
                     <child>
-                      <widget class="GtkComboBox" id="win_saveas_combo">
-                        <property name="visible">True</property>
-                        <property name="items" translatable="yes">Open in Excel
-Save as CSV</property>
-                      </widget>
-                    </child>
-                    <child>
                       <widget class="GtkVSeparator" id="vseparator9">
                         <property name="visible">True</property>
                       </widget>

_______________________________________________
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