[MERGE] document: fix spelling
authorRaphael Collet <rco@openerp.com>
Wed, 11 Jan 2012 15:00:47 +0000 (16:00 +0100)
committerRaphael Collet <rco@openerp.com>
Wed, 11 Jan 2012 15:00:47 +0000 (16:00 +0100)
bzr revid: rco@openerp.com-20120111150047-wk95ms1h2hg2cipq

33 files changed:
addons/account_coda/test_coda_file/Ontvangen CODA.2011-01-11-18.59.15.txt [deleted file]
addons/account_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt [new file with mode: 0644]
addons/crm/crm_lead_view.xml
addons/crm/crm_meeting_view.xml
addons/mrp/stock.py
addons/purchase/purchase.py
addons/stock/product.py
addons/stock/wizard/stock_move.py
addons/web/po/ru.po
addons/web/static/lib/jquery.contextmenu/jquery.contextmenu.r2.packed.js
addons/web/static/src/css/base.css
addons/web/static/src/js/chrome.js
addons/web/static/src/js/core.js
addons/web/static/src/js/data.js
addons/web/static/src/js/data_export.js
addons/web/static/src/js/data_import.js
addons/web/static/src/js/formats.js
addons/web/static/src/js/view_editor.js
addons/web/static/src/js/view_form.js
addons/web/static/src/js/view_list.js
addons/web/static/src/js/view_tree.js
addons/web/static/src/js/views.js
addons/web_calendar/po/pt_BR.po [new file with mode: 0644]
addons/web_calendar/static/src/css/web_calendar.css
addons/web_calendar/static/src/js/calendar.js
addons/web_dashboard/static/src/js/dashboard.js
addons/web_graph/po/pt_BR.po [new file with mode: 0644]
addons/web_graph/static/src/js/graph.js
addons/web_kanban/static/src/js/kanban.js
addons/web_mobile/static/src/js/form_mobile.js
addons/web_mobile/static/src/js/list_mobile.js
addons/web_process/static/src/js/process.js
addons/web_uservoice/static/src/js/web_uservoice.js

diff --git a/addons/account_coda/test_coda_file/Ontvangen CODA.2011-01-11-18.59.15.txt b/addons/account_coda/test_coda_file/Ontvangen CODA.2011-01-11-18.59.15.txt
deleted file mode 100644 (file)
index bc3af59..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-0000011011172505        00178299  DE MEYER LUC              KREDBEBB   00820512013 00000                                       2\r
-12135BE33737018595246                  EUR0000000011812700270710NOVIAT NV                 KBC-Business Comfortrekening       003\r
-2100010000OL44483FW SCTOFBIONLO1000000000435000110111001010000MEDEDELING                                           11011113501 0\r
-2200010000                                                                                        GKCCBEBB                   1 0\r
-2300010000BE41063012345610                     PARTNER 1                                                                     0 1\r
-3100010001OL44483FW SCTOFBIONLO001010001001PARTNER 1                                                                         0 0\r
-2100020000OL4414AC8BOVSOVSOVERS00000000030444501101110015000002010237                                              11011113501 0\r
-2200020000                                                                                        BBRUBEBB                   1 0\r
-2300020000BE61310126985517                     PARTNER 2                                                                     0 1\r
-3100020001OL4414AC8BOVSOVSOVERS001500001001PARTNER 2                                                                         1 0\r
-3200020001MOLENSTRAAT 60                     9340    LEDE                                                                    0 0\r
-2100030000AFECA0CVA IKLINNINNIG1000000000479040110111313410000              KBC-INVESTERINGSKREDIET 737-6543210-21 11011113510 0\r
-2100030001AFECA0CVA IKLINNINNIG1000000000419920110111813410660                                                     11011113500 0\r
-2100030002AFECA0CVA IKLINNINNIG1000000000059120110111813410020                                                     11011113510 0\r
-2100040000AFECA0CVA IKLINNINNIG1000000000479040110111313410000              KBC-INVESTERINGSKREDIET 737-6543210-21 11011113510 0\r
-2100040001AFECA0CVA IKLINNINNIG1000000000419920110111813410660                                                     11011113500 0\r
-2100040002AFECA0CVA IKLINNINNIG1000000000059120110111813410020                                                     11011113510 0\r
-2100050000AOGM00160BSCTOBOGOVER0000000000063740110111001500000TERUGGAVE 37232481 8400083296 .                      11011113501 0\r
-2200050000                                                     362/363                            KREDBEBB                   1 0\r
-2300050000BE43730004200601                     KBC VERZEKERINGEN NV                                                          0 1\r
-3100050001AOGM00160BSCTOBOGOVER001500001001KBC VERZEKERINGEN NV                                                              1 0\r
-3200050001VAN OVERSTRAETENPLEIN 2            3000    LEUVEN                                                                  0 0\r
-8135BE44734024486445                  EUR0000000013527810110111                                                                0\r
-9               000022000000001393080000000003108190                                                                           2\r
diff --git a/addons/account_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt b/addons/account_coda/test_coda_file/Ontvangen_CODA.2011-01-11-18.59.15.txt
new file mode 100644 (file)
index 0000000..bc3af59
--- /dev/null
@@ -0,0 +1,24 @@
+0000011011172505        00178299  DE MEYER LUC              KREDBEBB   00820512013 00000                                       2\r
+12135BE33737018595246                  EUR0000000011812700270710NOVIAT NV                 KBC-Business Comfortrekening       003\r
+2100010000OL44483FW SCTOFBIONLO1000000000435000110111001010000MEDEDELING                                           11011113501 0\r
+2200010000                                                                                        GKCCBEBB                   1 0\r
+2300010000BE41063012345610                     PARTNER 1                                                                     0 1\r
+3100010001OL44483FW SCTOFBIONLO001010001001PARTNER 1                                                                         0 0\r
+2100020000OL4414AC8BOVSOVSOVERS00000000030444501101110015000002010237                                              11011113501 0\r
+2200020000                                                                                        BBRUBEBB                   1 0\r
+2300020000BE61310126985517                     PARTNER 2                                                                     0 1\r
+3100020001OL4414AC8BOVSOVSOVERS001500001001PARTNER 2                                                                         1 0\r
+3200020001MOLENSTRAAT 60                     9340    LEDE                                                                    0 0\r
+2100030000AFECA0CVA IKLINNINNIG1000000000479040110111313410000              KBC-INVESTERINGSKREDIET 737-6543210-21 11011113510 0\r
+2100030001AFECA0CVA IKLINNINNIG1000000000419920110111813410660                                                     11011113500 0\r
+2100030002AFECA0CVA IKLINNINNIG1000000000059120110111813410020                                                     11011113510 0\r
+2100040000AFECA0CVA IKLINNINNIG1000000000479040110111313410000              KBC-INVESTERINGSKREDIET 737-6543210-21 11011113510 0\r
+2100040001AFECA0CVA IKLINNINNIG1000000000419920110111813410660                                                     11011113500 0\r
+2100040002AFECA0CVA IKLINNINNIG1000000000059120110111813410020                                                     11011113510 0\r
+2100050000AOGM00160BSCTOBOGOVER0000000000063740110111001500000TERUGGAVE 37232481 8400083296 .                      11011113501 0\r
+2200050000                                                     362/363                            KREDBEBB                   1 0\r
+2300050000BE43730004200601                     KBC VERZEKERINGEN NV                                                          0 1\r
+3100050001AOGM00160BSCTOBOGOVER001500001001KBC VERZEKERINGEN NV                                                              1 0\r
+3200050001VAN OVERSTRAETENPLEIN 2            3000    LEUVEN                                                                  0 0\r
+8135BE44734024486445                  EUR0000000013527810110111                                                                0\r
+9               000022000000001393080000000003108190                                                                           2\r
index 56ee5e3..44d83f4 100644 (file)
                 <button name="case_close" string="Close"
                     states="open,draft,pending" type="object"
                     icon="gtk-close" />
-                <button string="Convert to Opportunity"
-                    name="convert_opportunity"
-                    states="draft,open,pending" icon="gtk-go-forward"
-                    type="object" />
+                <button name="%(crm.action_crm_lead2opportunity_partner)d"
+                    string="Convert to Opportunity"
+                    states="draft,open,pending" icon="gtk-index"
+                    type="action" />
                 <button name="case_escalate" string="Escalate"
                     states="open,draft,pending" type="object"
                     icon="gtk-go-up" />
index ae5da24..850d806 100644 (file)
         <field name="arch" type="xml">
             <tree string="Meetings"
                 colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
-                <field name="state" invisible="1"/>
                 <field name="name" string="Subject" />
                 <field name="user_id"/>
                 <field name="date"/>
                 <field name="duration" />
                 <field name="partner_id" string="Partner" />
                 <field name="location" />
+                <field name="categ_id" groups="base.group_extended" />
             </tree>
         </field>
     </record>
index a486e0b..d5ddc7f 100644 (file)
@@ -168,23 +168,20 @@ class StockPicking(osv.osv):
 StockPicking()
 
 
-class spilt_in_production_lot(osv.osv_memory):
+class split_in_production_lot(osv.osv_memory):
     _inherit = "stock.move.split"
-    
+
     def split(self, cr, uid, ids, move_ids, context=None):
         """ Splits move lines into given quantities.
         @param move_ids: Stock moves.
         @return: List of new moves.
-        """  
+        """
+        new_moves = super(split_in_production_lot, self).split(cr, uid, ids, move_ids, context=context)
         production_obj = self.pool.get('mrp.production')
-        move_obj = self.pool.get('stock.move')  
-        res = []
-        for move in move_obj.browse(cr, uid, move_ids, context=context):
-            new_moves = super(spilt_in_production_lot, self).split(cr, uid, ids, move_ids, context=context)
-            production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
-            for new_move in new_moves:
-                production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})                
-        return res
-    
-spilt_in_production_lot()
+        production_ids = production_obj.search(cr, uid, [('move_lines', 'in', move_ids)])
+        production_obj.write(cr, uid, production_ids, {'move_lines': [(4, m) for m in new_moves]})
+        return new_moves
+
+split_in_production_lot()
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 54fb226..6dd6db4 100644 (file)
@@ -715,11 +715,11 @@ class purchase_order_line(osv.osv):
         res = {}
         prod= self.pool.get('product.product').browse(cr, uid, product)
         product_uom_pool = self.pool.get('product.uom')
+
         lang=False
         if partner_id:
             lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang']
-        context={'lang':lang}
-        context['partner_id'] = partner_id
+        context_partner = {'lang': lang, 'partner_id': partner_id}
 
         prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
         prod_uom_po = prod.uom_po_id.id
@@ -735,7 +735,7 @@ class purchase_order_line(osv.osv):
             if uom1_cat != uom2_cat:
                 uom = False
 
-        prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id], context=context)[0][1]
+        prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id], context=context_partner)[0][1]
         res = {}
         for s in prod.seller_ids:
             if s.name.id == partner_id:
index a6198ef..304fa8d 100644 (file)
@@ -184,6 +184,7 @@ class product_product(osv.osv):
         
         location_obj = self.pool.get('stock.location')
         warehouse_obj = self.pool.get('stock.warehouse')
+        shop_obj = self.pool.get('sale.shop')
         
         states = context.get('states',[])
         what = context.get('what',())
@@ -193,18 +194,15 @@ class product_product(osv.osv):
         if not ids:
             return res
 
-    # TODO: write in more ORM way, less queries, more pg84 magic
         if context.get('shop', False):
-            cr.execute('select warehouse_id from sale_shop where id=%s', (int(context['shop']),))
-            res2 = cr.fetchone()
-            if res2:
-                context['warehouse'] = res2[0]
+            warehouse_id = shop_obj.read(cr, uid, int(context['shop']), ['warehouse_id'])['warehouse_id'][0]
+            if warehouse_id:
+                context['warehouse'] = warehouse_id
 
         if context.get('warehouse', False):
-            cr.execute('select lot_stock_id from stock_warehouse where id=%s', (int(context['warehouse']),))
-            res2 = cr.fetchone()
-            if res2:
-                context['location'] = res2[0]
+            lot_id = warehouse_obj.read(cr, uid, int(context['warehouse']), ['lot_stock_id'])['lot_stock_id'][0]
+            if lot_id:
+                context['location'] = lot_id
 
         if context.get('location', False):
             if type(context['location']) == type(1):
index e7cd5a4..a22ea72 100644 (file)
@@ -205,8 +205,13 @@ class split_in_production_lot(osv.osv_memory):
                     lines = [l for l in data.line_exist_ids if l]
                 else:
                     lines = [l for l in data.line_ids if l]
+                total_move_qty = 0.0
                 for line in lines:
                     quantity = line.quantity
+                    total_move_qty += quantity
+                    if total_move_qty > move_qty:
+                        raise osv.except_osv(_('Processing Error'), _('Production lot quantity %d of %s is larger than available quantity (%d) !') \
+                                % (total_move_qty, move.product_id.name, move_qty))
                     if quantity <= 0 or move_qty == 0:
                         continue
                     quantity_rest -= quantity
index beecb02..0347a9e 100644 (file)
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: openerp-web\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 "POT-Creation-Date: 2011-12-20 18:48+0100\n"
-"PO-Revision-Date: 2011-12-06 08:05+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2012-01-10 10:48+0000\n"
+"Last-Translator: Aleksei Motsik <Unknown>\n"
 "Language-Team: Russian <ru@li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n"
-"X-Generator: Launchpad (build 14616)\n"
+"X-Launchpad-Export-Date: 2012-01-11 04:55+0000\n"
+"X-Generator: Launchpad (build 14640)\n"
 
 #: addons/web/static/src/js/chrome.js:162
 #: addons/web/static/src/js/chrome.js:175
@@ -28,15 +28,15 @@ msgstr ""
 
 #: addons/web/static/src/js/chrome.js:668
 msgid "About"
-msgstr ""
+msgstr "О программе"
 
 #: addons/web/static/src/js/chrome.js:748
 msgid "Preferences"
-msgstr ""
+msgstr "Настройки"
 
 #: addons/web/static/src/js/chrome.js:752
 msgid "Change password"
-msgstr ""
+msgstr "Изменить пароль"
 
 #: addons/web/static/src/js/chrome.js:753
 #: addons/web/static/src/js/search.js:235
@@ -47,21 +47,21 @@ msgstr ""
 #: addons/web/static/src/js/view_form.js:1085
 #: addons/web/static/src/xml/base.xml:0
 msgid "Cancel"
-msgstr ""
+msgstr "Отмена"
 
 #: addons/web/static/src/js/chrome.js:754
 #: addons/web/static/src/js/view_editor.js:75
 #: addons/web/static/src/js/views.js:871 addons/web/static/src/xml/base.xml:0
 msgid "Save"
-msgstr ""
+msgstr "Сохранить"
 
 #: addons/web/static/src/js/chrome.js:774 addons/web/static/src/xml/base.xml:0
 msgid "Change Password"
-msgstr ""
+msgstr "Изменить пароль"
 
 #: addons/web/static/src/js/data_export.js:6
 msgid "Export Data"
-msgstr ""
+msgstr "Экспорт данных"
 
 #: addons/web/static/src/js/data_export.js:23
 #: addons/web/static/src/js/data_import.js:73
@@ -70,7 +70,7 @@ msgstr ""
 #: addons/web/static/src/js/view_form.js:2775
 #: addons/web/static/src/js/views.js:872
 msgid "Close"
-msgstr ""
+msgstr "Закрыть"
 
 #: addons/web/static/src/js/data_export.js:24
 msgid "Export To File"
@@ -78,32 +78,32 @@ msgstr ""
 
 #: addons/web/static/src/js/data_import.js:34
 msgid "Import Data"
-msgstr ""
+msgstr "Импорт данных"
 
 #: addons/web/static/src/js/data_import.js:74
 msgid "Import File"
-msgstr ""
+msgstr "Импортировать файл"
 
 #: addons/web/static/src/js/data_import.js:109
 msgid "External ID"
-msgstr ""
+msgstr "Внешний идентификатор"
 
 #: addons/web/static/src/js/search.js:233
 msgid "Filter Entry"
-msgstr ""
+msgstr "Входящий фильтр"
 
 #: addons/web/static/src/js/search.js:238
 #: addons/web/static/src/js/search.js:279
 msgid "OK"
-msgstr ""
+msgstr "OK"
 
 #: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0
 msgid "Add to Dashboard"
-msgstr ""
+msgstr "Добавить на Панель"
 
 #: addons/web/static/src/js/search.js:403
 msgid "Invalid Search"
-msgstr ""
+msgstr "Ошибка поиска"
 
 #: addons/web/static/src/js/search.js:403
 msgid "triggered from search view"
@@ -113,30 +113,31 @@ msgstr ""
 #, python-format
 msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s"
 msgstr ""
+"Некорректное значение для поля %(fieldname)s: [%(value)s] в %(message)s"
 
 #: addons/web/static/src/js/search.js:822
 msgid "not a valid integer"
-msgstr ""
+msgstr "не является целым числом"
 
 #: addons/web/static/src/js/search.js:836
 msgid "not a valid number"
-msgstr ""
+msgstr "не является числом"
 
 #: addons/web/static/src/js/search.js:898
 msgid "Yes"
-msgstr ""
+msgstr "Да"
 
 #: addons/web/static/src/js/search.js:899
 msgid "No"
-msgstr ""
+msgstr "Нет"
 
 #: addons/web/static/src/js/search.js:1252
 msgid "contains"
-msgstr ""
+msgstr "содержит"
 
 #: addons/web/static/src/js/search.js:1253
 msgid "doesn't contain"
-msgstr ""
+msgstr "не содержит"
 
 #: addons/web/static/src/js/search.js:1254
 #: addons/web/static/src/js/search.js:1269
@@ -144,7 +145,7 @@ msgstr ""
 #: addons/web/static/src/js/search.js:1309
 #: addons/web/static/src/js/search.js:1331
 msgid "is equal to"
-msgstr ""
+msgstr "соответствует"
 
 #: addons/web/static/src/js/search.js:1255
 #: addons/web/static/src/js/search.js:1270
@@ -152,7 +153,7 @@ msgstr ""
 #: addons/web/static/src/js/search.js:1310
 #: addons/web/static/src/js/search.js:1332
 msgid "is not equal to"
-msgstr ""
+msgstr "не соответствует"
 
 #: addons/web/static/src/js/search.js:1256
 #: addons/web/static/src/js/search.js:1271
@@ -160,7 +161,7 @@ msgstr ""
 #: addons/web/static/src/js/search.js:1311
 #: addons/web/static/src/js/search.js:1333
 msgid "greater than"
-msgstr ""
+msgstr "больше чем"
 
 #: addons/web/static/src/js/search.js:1257
 #: addons/web/static/src/js/search.js:1272
@@ -168,7 +169,7 @@ msgstr ""
 #: addons/web/static/src/js/search.js:1312
 #: addons/web/static/src/js/search.js:1334
 msgid "less than"
-msgstr ""
+msgstr "меньше чем"
 
 #: addons/web/static/src/js/search.js:1258
 #: addons/web/static/src/js/search.js:1273
@@ -176,7 +177,7 @@ msgstr ""
 #: addons/web/static/src/js/search.js:1313
 #: addons/web/static/src/js/search.js:1335
 msgid "greater or equal than"
-msgstr ""
+msgstr "больше или равен"
 
 #: addons/web/static/src/js/search.js:1259
 #: addons/web/static/src/js/search.js:1274
index 2356f3b..47f542e 100644 (file)
                 display(index,this,e,options);
             return false;
         };
-        $(this).bind('contextmenu', callback);
-        if(options.leftClickToo) {
+        if (!options.noRightClick) {
+            $(this).bind('contextmenu', callback);
+        }
+        if (options.leftClickToo || options.noRightClick) {
             $(this).click(callback);
         }
         return this
 })(jQuery);
 $( function() {
     $('div.contextMenu').hide()
-});
\ No newline at end of file
+});
index df6d78e..6da9f1b 100644 (file)
@@ -2033,6 +2033,7 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
 
 .openerp .oe_vm_switch_form,
 .openerp .oe_vm_switch_page,
+.openerp .oe_vm_switch_tree,
 .openerp .oe_vm_switch_list,
 .openerp .oe_vm_switch_graph,
 .openerp .oe_vm_switch_gantt,
@@ -2049,6 +2050,7 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
 
 .openerp .oe_vm_switch_form span,
 .openerp .oe_vm_switch_page span,
+.openerp .oe_vm_switch_tree span,
 .openerp .oe_vm_switch_list span,
 .openerp .oe_vm_switch_graph span,
 .openerp .oe_vm_switch_gantt span,
@@ -2068,6 +2070,16 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
     background-position: 0px -21px;
 }
 
+.openerp .oe_vm_switch_tree {
+    background-position: 0px 0px;
+}
+.openerp .oe_vm_switch_tree:active,
+.openerp .oe_vm_switch_tree:hover,
+.openerp .oe_vm_switch_tree:focus,
+.openerp .oe_vm_switch_tree[disabled="disabled"] {
+    background-position: 0px -21px;
+}
+
 .openerp .oe_vm_switch_form {
     background-position: -22px 0px;
 }
@@ -2078,6 +2090,15 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
     background-position: -22px -21px;
 }
 
+.openerp .oe_vm_switch_page {
+    background-position: -22px 0px;
+}
+.openerp .oe_vm_switch_page:active,
+.openerp .oe_vm_switch_page:hover,
+.openerp .oe_vm_switch_page:focus,
+.openerp .oe_vm_switch_page[disabled="disabled"] {
+    background-position: -22px -21px;
+}
 .openerp .oe_vm_switch_graph {
     background-position: -44px 0px;
 }
index 520345e..85a7c9f 100644 (file)
@@ -36,7 +36,7 @@ openerp.web.Notification =  openerp.web.Widget.extend(/** @lends openerp.web.Not
 
 });
 
-openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{
+openerp.web.Dialog = openerp.web.Widget.extend(/** @lends openerp.web.Dialog# */{
     dialog_title: "",
     identifier_prefix: 'dialog',
     /**
@@ -46,9 +46,12 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
      * @param parent
      * @param options
      */
-    init: function (parent, options) {
+    init: function (parent, options, content) {
         var self = this;
         this._super(parent);
+        if (content) {
+            this.$element = content instanceof $ ? content : $(content);
+        }
         this.dialog_options = {
             modal: true,
             destroy_on_close: true,
@@ -72,6 +75,11 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
         if (options) {
             _.extend(this.dialog_options, options);
         }
+        if (this.dialog_options.autoOpen) {
+            this.open();
+        } else {
+            this.$element.dialog(this.get_options());
+        }
     },
     get_options: function(options) {
         var self = this,
@@ -103,11 +111,6 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
             return parseInt(val, 10);
         }
     },
-    start: function () {
-        this.$element.dialog(this.dialog_options);
-        this._super();
-        return this;
-    },
     open: function(options) {
         // TODO fme: bind window on resize
         if (this.template) {
@@ -172,7 +175,7 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({
         var buttons = {};
         if (openerp.connection.openerp_entreprise) {
             buttons[_t("Send OpenERP Enterprise Report")] = function() {
-                $this = $(this);
+                var $this = $(this);
                 var issuename = $('#issuename').val();
                 var explanation = $('#explanation').val();
                 var remark = $('#remark').val();
@@ -195,13 +198,12 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({
         }
         var dialog = new openerp.web.Dialog(this, {
             title: "OpenERP " + _.str.capitalize(this.error.type),
-            autoOpen: true,
             width: '80%',
             height: '50%',
             min_width: '800px',
             min_height: '600px',
             buttons: buttons
-        }).start();
+        }).open();
         dialog.$element.html(QWeb.render('CrashManagerError', {session: openerp.connection, error: error}));
     },
 });
@@ -770,20 +772,20 @@ openerp.web.Header =  openerp.web.Widget.extend(/** @lends openerp.web.Header# *
             title: _t("Preferences"),
             width: '700px',
             buttons: [
-                {text: _t("Change password"), click: function(){ self.change_password(); }},
                 {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }},
+                {text: _t("Change password"), click: function(){ self.change_password(); }},
                 {text: _t("Save"), click: function(){
                         var inner_viewmanager = action_manager.inner_viewmanager;
                         inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save()
                         .then(function() {
                             self.dialog.stop();
+                            // needs to refresh interface in case language changed
                             window.location.reload();
                         });
                     }
                 }
             ]
-        });
-       this.dialog.start().open();
+        }).open();
        action_manager.appendTo(this.dialog);
        action_manager.render(this.dialog);
     },
@@ -793,8 +795,7 @@ openerp.web.Header =  openerp.web.Widget.extend(/** @lends openerp.web.Header# *
         this.dialog = new openerp.web.Dialog(this, {
             title: _t("Change Password"),
             width : 'auto'
-        });
-        this.dialog.start().open();
+        }).open();
         this.dialog.$element.html(QWeb.render("Change_Pwd", self));
         this.dialog.$element.find("form[name=change_password_form]").validate({
             submitHandler: function (form) {
@@ -1123,7 +1124,8 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
         this.$element.children().remove();
     },
     do_reload: function() {
-        return this.session.session_init().pipe(_.bind(function() {this.menu.do_reload();}, this));
+        return this.session.session_reload().pipe(
+            $.proxy(this.menu, 'do_reload'));
     },
     do_notify: function() {
         var n = this.notification;
@@ -1174,7 +1176,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
                 self.menu.on_menu_click(null, action.menu_id);
             });
         }
-    },
+    }
 });
 
 openerp.web.EmbeddedClient = openerp.web.Widget.extend({
index 8193852..a194c34 100644 (file)
@@ -547,7 +547,24 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
         var self = this;
         // TODO: session store in cookie should be optional
         this.session_id = this.get_cookie('session_id');
-        return this.rpc("/web/session/get_session_info", {}).pipe(function(result) {
+        return this.session_reload().pipe(function(result) {
+            var modules = openerp._modules.join(',');
+            var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb);
+            if(self.session_is_valid()) {
+                return deferred.pipe(function() { return self.load_modules(); });
+            }
+            return deferred;
+        });
+    },
+    /**
+     * (re)loads the content of a session: db name, username, user id, session
+     * context and status of the support contract
+     *
+     * @returns {$.Deferred} deferred indicating the session is done reloading
+     */
+    session_reload: function () {
+        var self = this;
+        return this.rpc("/web/session/get_session_info", {}).then(function(result) {
             // If immediately follows a login (triggered by trying to restore
             // an invalid session or no session at all), refresh session data
             // (should not change, but just in case...)
@@ -558,12 +575,6 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
                 user_context: result.context,
                 openerp_entreprise: result.openerp_entreprise
             });
-            var modules = openerp._modules.join(',');
-            var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb);
-            if(self.session_is_valid()) {
-                return deferred.pipe(function() { self.load_modules(); });
-            }
-            return deferred;
         });
     },
     session_is_valid: function() {
index 3b444df..663e596 100644 (file)
@@ -293,16 +293,16 @@ openerp.web.DataSet =  openerp.web.Widget.extend( /** @lends openerp.web.DataSet
      *
      * @param {Array} ids identifiers of the records to read
      * @param {Array} fields fields to read and return, by default all fields are returned
-     * @param {Function} callback function called with read result
      * @returns {$.Deferred}
      */
-    read_ids: function (ids, fields, callback) {
+    read_ids: function (ids, fields, options) {
+        var options = options || {};
         return this.rpc('/web/dataset/get', {
             model: this.model,
             ids: ids,
             fields: fields,
-            context: this.get_context()
-        }, callback);
+            context: this.get_context(options.context)
+        });
     },
     /**
      * Read a slice of the records represented by this DataSet, based on its
@@ -312,22 +312,20 @@ openerp.web.DataSet =  openerp.web.Widget.extend( /** @lends openerp.web.DataSet
      * @params {Object} options
      * @param {Number} [options.offset=0] The index from which selected records should be returned
      * @param {Number} [options.limit=null] The maximum number of records to return
-     * @param {Function} callback function called with read_slice result
      * @returns {$.Deferred}
      */
-    read_slice: function (fields, options, callback) { 
-        return null; 
+    read_slice: function (fields, options) {
+        return null;
     },
     /**
      * Reads the current dataset record (from its index)
      *
      * @params {Array} [fields] fields to read and return, by default all fields are returned
      * @param {Object} [options.context] context data to add to the request payload, on top of the DataSet's own context
-     * @params {Function} callback function called with read_index result
      * @returns {$.Deferred}
      */
-    read_index: function (fields, options, callback) {
-        var def = $.Deferred().then(callback);
+    read_index: function (fields, options) {
+        var def = $.Deferred();
         if (_.isEmpty(this.ids)) {
             def.reject();
         } else {
@@ -344,15 +342,16 @@ openerp.web.DataSet =  openerp.web.Widget.extend( /** @lends openerp.web.DataSet
      * Reads default values for the current model
      *
      * @param {Array} [fields] fields to get default values for, by default all defaults are read
-     * @param {Function} callback function called with default_get result
+     * @param {Object} [options.context] context data to add to the request payload, on top of the DataSet's own context
      * @returns {$.Deferred}
      */
-    default_get: function(fields, callback) {
+    default_get: function(fields, options) {
+        var options = options || {};
         return this.rpc('/web/dataset/default_get', {
             model: this.model,
             fields: fields,
-            context: this.get_context()
-        }, callback);
+            context: this.get_context(options.context)
+        });
     },
     /**
      * Creates a new record in db
@@ -504,14 +503,14 @@ openerp.web.DataSetStatic =  openerp.web.DataSet.extend({
         // all local records
         this.ids = ids || [];
     },
-    read_slice: function (fields, options, callback) {
+    read_slice: function (fields, options) {
         // TODO remove fields from options
         var self = this,
             offset = options.offset || 0,
             limit = options.limit || false,
             fields = fields || false;
         var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length;
-        return this.read_ids(this.ids.slice(offset, end_pos), fields, callback);
+        return this.read_ids(this.ids.slice(offset, end_pos), fields);
     },
     set_ids: function (ids) {
         this.ids = ids;
@@ -558,10 +557,9 @@ openerp.web.DataSetSearch =  openerp.web.DataSet.extend(/** @lends openerp.web.D
      * @param {Array} [options.domain] domain data to add to the request payload, ANDed with the dataset's domain
      * @param {Number} [options.offset=0] The index from which selected records should be returned
      * @param {Number} [options.limit=null] The maximum number of records to return
-     * @param {Function} callback function called with read_slice result
      * @returns {$.Deferred}
      */
-    read_slice: function (fields, options, callback) {
+    read_slice: function (fields, options) {
         var self = this;
         var options = options || {};
         var offset = options.offset || 0;
@@ -577,7 +575,7 @@ openerp.web.DataSetSearch =  openerp.web.DataSet.extend(/** @lends openerp.web.D
             self.ids = result.ids;
             self.offset = offset;
             return result.records;
-        }).then(callback);
+        });
     },
     get_domain: function (other_domain) {
         if (other_domain) {
@@ -631,8 +629,8 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
         this.reset_ids([]);
         this.last_default_get = {};
     },
-    default_get: function(fields, callback) {
-        return this._super(fields).then(this.on_default_get).then(callback);
+    default_get: function(fields, options) {
+        return this._super(fields, options).then(this.on_default_get);
     },
     on_default_get: function(res) {
         this.last_default_get = res;
@@ -700,7 +698,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
         this.delete_all = false;
     },
     on_change: function() {},
-    read_ids: function (ids, fields, callback) {
+    read_ids: function (ids, fields, options) {
         var self = this;
         var to_get = [];
         _.each(ids, function(id) {
@@ -714,7 +712,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
                     to_get.push(id);
             }
         });
-        var completion = $.Deferred().then(callback);
+        var completion = $.Deferred();
         var return_records = function() {
             var records = _.map(ids, function(id) {
                 return _.extend({}, _.detect(self.cache, function(c) {return c.id === id;}).values, {"id": id});
@@ -727,7 +725,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
             completion.resolve(records);
         };
         if(to_get.length > 0) {
-            var rpc_promise = this._super(to_get, fields, function(records) {
+            var rpc_promise = this._super(to_get, fields, options).then(function(records) {
                 _.each(records, function(record, index) {
                     var id = to_get[index];
                     var cached = _.detect(self.cache, function(x) {return x.id === id;});
@@ -776,8 +774,8 @@ openerp.web.ProxyDataSet = openerp.web.DataSetSearch.extend({
             return this._super.apply(this, arguments);
         }
     },
-    default_get: function(fields, callback) {
-        return this._super(fields, callback).then(this.on_default_get);
+    default_get: function(fields, options) {
+        return this._super(fields, options).then(this.on_default_get);
     },
     on_default_get: function(result) {},
     create: function(data, callback, error_callback) {
index c6fe964..1382bf8 100644 (file)
@@ -74,7 +74,7 @@ openerp.web.DataExport = openerp.web.Dialog.extend({
         }
         return this.exports.read_slice(['name'], {
             domain: [['resource', '=', this.dataset.model]]
-        }, function (export_list) {
+        }).then(function (export_list) {
             if (!export_list.length) {
                 return;
             }
index 2b25245..18870ca 100644 (file)
@@ -83,7 +83,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
             'fields_get', [], function (fields) {
                 self.graft_fields(fields);
                 self.ready.push(new openerp.web.DataSet(self, self.model)
-                        .default_get(_.pluck(self.fields, 'id'), function (fields) {
+                        .default_get(_.pluck(self.fields, 'id')).then(function (fields) {
                     _.each(fields, function(val, key) {
                         if (val) {
                             self.fields_with_defaults.push(key);
index 819301f..7f220d0 100644 (file)
@@ -102,10 +102,6 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
             return _.str.sprintf("%02d:%02d",
                     Math.floor(value),
                     Math.round((value % 1) * 60));
-        case 'progressbar':
-            return _.str.sprintf(
-                '<progress value="%.2f" max="100.0">%.2f%%</progress>',
-                    value, value);
         case 'many2one':
             // name_get value format
             return value[1];
@@ -284,7 +280,7 @@ openerp.web.format_cell = function (row_data, column, options) {
         return options.value_if_empty === undefined ? '' : options.value_if_empty;
     }
 
-    switch (column.type) {
+    switch (column.widget || column.type) {
     case "boolean":
         return _.str.sprintf('<input type="checkbox" %s disabled="disabled"/>',
                  row_data[column.id].value ? 'checked="checked"' : '');
@@ -298,15 +294,20 @@ openerp.web.format_cell = function (row_data, column, options) {
                         row_data[column.filename].value, {type: 'char'}));
             }
         }
-        return _.str.sprintf('<a href="%(href)s">%(text)s</a> (%(size)s)', {
+        return _.template('<a href="<%-href%>"><%-text%></a> (%<-size%>)', {
             text: text,
             href: download_url,
             size: row_data[column.id].value
         });
+    case 'progressbar':
+        return _.template(
+            '<progress value="<%-value%>" max="100"><%-value%>%</progress>', {
+                value: row_data[column.id].value
+            });
     }
 
-    return openerp.web.format_value(
-            row_data[column.id].value, column, options.value_if_empty);
+    return _.escape(openerp.web.format_value(
+            row_data[column.id].value, column, options.value_if_empty));
 }
 
 };
index 649f324..bf92038 100644 (file)
@@ -16,9 +16,10 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
         this.init_view_editor();
     },
     init_view_editor: function() {
-        var self = this;
+        var self = this,
+            action_title = _.str.sprintf(_t("Manage Views (%s)"), this.model);
         var action = {
-            name: _.str.sprintf("Manage Views (%s)", this.model),
+            name: action_title,
             context: this.session.user_context,
             domain: [["model", "=", this.model]],
             res_model: 'ir.ui.view',
@@ -38,7 +39,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
             }
         };
         this.view_edit_dialog = new openerp.web.Dialog(this, {
-            title: _t("ViewEditor"),
+            title: action_title,
             width: 850,
             buttons: [
                 {text: _t("Create"), click: function() { self.on_create_view(); }},
@@ -46,7 +47,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                 {text: _t("Remove"), click: function() { self.do_delete_view(); }},
                 {text: _t("Close"), click: function() { self.view_edit_dialog.close(); }}
             ]
-        }).start().open();
+        }).open();
         this.main_view_id = this.parent.fields_view.view_id;
         this.action_manager = new openerp.web.ActionManager(this);
         this.action_manager.appendTo(this.view_edit_dialog);
@@ -91,8 +92,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                 }},
                 {text: _t("Cancel"), click: function () { self.create_view_dialog.close(); }}
             ]
-        });
-        this.create_view_dialog.start().open();
+        }).open();
         var view_widget = [{'name': 'view_name', 'string':'View Name', 'type': 'char', 'required': true, 'value' : this.model + '.custom_' + Math.round(Math.random() * 1000)},
                            {'name': 'view_type', 'string': 'View Type', 'type': 'selection', 'required': true, 'value': 'Form', 'selection': [['',''],['tree', 'Tree'],['form', 'Form'],['graph', 'Graph'],['calendar', 'Calender']]},
                            {'name': 'proirity', 'string': 'Priority', 'type': 'float', 'required': true, 'value':'16'}];
@@ -124,7 +124,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                 }
             });
             if (field_name) {
-                model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}, function(records) {
+                model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}).then(function(records) {
                     if (records) {view_string = records[0].name;}
                     var arch = _.str.sprintf("<?xml version='1.0'?>\n<%s string='%s'>\n\t<field name='%s'/>\n</%s>", values.view_type, view_string, field_name, values.view_type);
                     var vals = {'model': self.model, 'name': values.view_name, 'priority': values.priority, 'type': values.view_type, 'arch': arch};
@@ -227,12 +227,12 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
     get_arch: function() {
         var self = this;
         var view_arch_list = [];
-        this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type'], function(arch) {
+        this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type']).then(function(arch) {
             if (arch.length) {
                 var arch_object = self.parse_xml(arch[0].arch, self.main_view_id);
                 self.main_view_type = arch[0].type == 'tree'? 'list': arch[0].type;
                 view_arch_list.push({"view_id": self.main_view_id, "arch": arch[0].arch});
-                self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}, function(result) {
+                self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).then(function(result) {
                     _.each(result, function(res) {
                         view_arch_list.push({"view_id": res.id, "arch": res.arch});
                         self.inherit_view(arch_object, res);
@@ -381,7 +381,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                     self.edit_xml_dialog.close();
                 }}
             ]
-        }).start().open();
+        }).open();
         var no_property_att = [];
         _.each(_PROPERTIES, function(val, key) {
             if (! val.length) no_property_att.push(key);
@@ -768,8 +768,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                 }},
                 {text: _t("Cancel"), click: function () { self.edit_node_dialog.close(); }}
             ]
-        });
-        this.edit_node_dialog.start().open();
+        }).open();
         var _PROPERTIES_ATTRIBUTES = {
             'name' : {'name':'name', 'string': 'Name', 'type': 'char'},
             'string' : {'name':'string', 'string': 'String', 'type': 'char'},
@@ -895,7 +894,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
                 }},
                 {text: _t("Cancel"), click: function() { self.add_node_dialog.close(); }}
             ]
-        }).start().open();
+        }).open();
         this.add_node_dialog.$element.append('<table id="rec_table"  style="width:420px" class="oe_forms"><tbody><tr></tbody></table>');
         var table_selector = self.add_node_dialog.$element.find('table[id=rec_table] tbody');
         _.each(render_list, function(node) {
@@ -915,7 +914,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
         table_selector.find("td[id^=]").attr("width","100px");
         self.add_node_dialog.$element.find('#new_field').click(function() {
             model_data = new openerp.web.DataSetSearch(self,'ir.model', null, null);
-            model_data.read_slice([], {domain: [['model','=', self.model]]}, function(result) {
+            model_data.read_slice([], {domain: [['model','=', self.model]]}).then(function(result) {
                 self.render_new_field(result[0].id);
             });
         });
@@ -939,7 +938,7 @@ openerp.web.ViewEditor =   openerp.web.Widget.extend({
             controller.do_set_readonly.add_last(function(){
                 action_manager.stop();
                 new_fields_name = new openerp.web.DataSetSearch(self,'ir.model.fields', null, null);
-                new_fields_name.read_ids([controller.datarecord.id], ['name'], function(result) {
+                new_fields_name.read_ids([controller.datarecord.id], ['name']).then(function(result) {
                 self.add_node_dialog.$element.find('select[id=field_value]').append($("<option selected></option>").attr("value", result[0].name).text(result[0].name));
                     _.detect(self.add_widget,function(widget){
                         widget.name == "field_value"? widget.selection.push(result[0].name): false;
index 2d0cf21..1531f32 100644 (file)
@@ -143,7 +143,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
                 // null index means we should start a new record
                 result = self.on_button_new();
             } else {
-                result = self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_record_loaded);
+                result = self.dataset.read_index(_.keys(self.fields_view.fields), {
+                    context : { 'bin_size' : true }
+                }).pipe(self.on_record_loaded);
             }
             result.pipe(function() {
                 self.$element.css('visibility', 'visible');
@@ -526,7 +528,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
             if (self.dataset.index == null || self.dataset.index < 0) {
                 return $.when(self.on_button_new());
             } else {
-                return self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_record_loaded);
+                return self.dataset.read_index(_.keys(self.fields_view.fields), {
+                    context : { 'bin_size' : true }
+                }).pipe(self.on_record_loaded);
             }
         });
     },
@@ -625,7 +629,7 @@ openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({
                     ['res_model', '=', this.view.dataset.model],
                     ['res_id', '=', this.view.datarecord.id],
                     ['type', 'in', ['binary', 'url']]
-                ])).read_slice(['name', 'url', 'type'], {}, this.on_attachments_loaded);
+                ])).read_slice(['name', 'url', 'type'], {}).then(this.on_attachments_loaded);
         }
     },
     on_attachments_loaded: function(attachments) {
@@ -1698,9 +1702,8 @@ openerp.web.form.dialog = function(content, options) {
         height: 'auto',
         min_width: '800px'
     }, options || {});
-    options.autoOpen = true;
-    var dialog = new openerp.web.Dialog(null, options).open();
-    return dialog.$element.html(content);
+    var dialog = new openerp.web.Dialog(null, options, content).open();
+    return dialog.$element;
 };
 
 openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
@@ -1759,7 +1762,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
                         self.open_related(self.related_entries[i]);
                     };
                 });
-                var cmenu = self.$menu_btn.contextMenu(self.cm_id, {'leftClickToo': true,
+                var cmenu = self.$menu_btn.contextMenu(self.cm_id, {'noRightClick': true,
                     bindings: bindings, itemStyle: {"color": ""},
                     onContextMenu: function() {
                         if(self.value) {
@@ -1779,7 +1782,6 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
             });
         });
         var ctx_callback = function(e) {init_context_menu_def.resolve(e); e.preventDefault()};
-        this.$menu_btn.bind('contextmenu', ctx_callback);
         this.$menu_btn.click(ctx_callback);
 
         // some behavior for input
@@ -2423,7 +2425,10 @@ openerp.web.form.One2ManyFormView = openerp.web.FormView.extend({
     form_template: 'One2Many.formview',
     on_loaded: function(data) {
         this._super(data);
-        this.$form_header.find('button.oe_form_button_create').click(this.on_button_new);
+        var self = this;
+        this.$form_header.find('button.oe_form_button_create').click(function() {
+            self.do_save().then(self.on_button_new);
+        });
     }
 });
 
index 70ae337..63f9dfd 100644 (file)
@@ -694,8 +694,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
 
             $footer_cells.filter(_.str.sprintf('[data-field=%s]', column.id))
                 .html(openerp.web.format_cell(aggregation, column, {
-                    process_modifiers: false,
-                    model: self.dataset.model
+                    process_modifiers: false
             }));
         });
     },
@@ -1017,14 +1016,13 @@ openerp.web.ListView.List = openerp.web.Class.extend( /** @lends openerp.web.Lis
             [record.get('id')],
             _.pluck(_(this.columns).filter(function (r) {
                     return r.tag === 'field';
-                }), 'name'),
-            function (records) {
-                _(records[0]).each(function (value, key) {
-                    record.set(key, value, {silent: true});
-                });
-                record.trigger('change', record);
-            }
-        );
+                }), 'name')
+        ).then(function (records) {
+            _(records[0]).each(function (value, key) {
+                record.set(key, value, {silent: true});
+            });
+            record.trigger('change', record);
+        });
     },
     /**
      * Renders a list record to HTML
@@ -1223,9 +1221,8 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
                     $group_column.html(openerp.web.format_cell(
                         row_data, group_column, {
                             value_if_empty: _t("Undefined"),
-                            process_modifiers: false,
-                            model: self.dataset.model
-                        }));
+                            process_modifiers: false
+                    }));
                 } catch (e) {
                     $group_column.html(row_data[group_column.id].value);
                 }
@@ -1305,7 +1302,7 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
         var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name');
         var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
         //TODO xmo: investigate why we need to put the setTimeout
-        $.async_when().then(function() {dataset.read_slice(fields, options , function (records) {
+        $.async_when().then(function() {dataset.read_slice(fields, options).then(function (records) {
             // FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
             if (self.records.length) {
                 self.records.reset(null, {silent: true});
index 528a31c..902b5a9 100644 (file)
@@ -86,7 +86,7 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
             'toolbar': has_toolbar
         }));
 
-        this.dataset.read_slice(this.fields_list(), {}, function (records) {
+        this.dataset.read_slice(this.fields_list()).then(function(records) {
             if (!has_toolbar) {
                 // WARNING: will do a second read on the same ids, but only on
                 //          first load so not very important
@@ -192,7 +192,7 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
     getdata: function (id, children_ids) {
         var self = this;
 
-        self.dataset.read_ids(children_ids, this.fields_list(), function (records) {
+        self.dataset.read_ids(children_ids, this.fields_list()).then(function(records) {
             _(records).each(function (record) {
                 self.records[record.id] = record;
             });
index 1811965..f8bdd58 100644 (file)
@@ -128,8 +128,7 @@ session.web.ActionManager = session.web.Widget.extend({
                 .contains(action.res_model)) {
             var old_close = on_close;
             on_close = function () {
-                session.webclient.do_reload();
-                if (old_close) { old_close(); }
+                session.webclient.do_reload().then(old_close);
             };
         }
         if (action.target === 'new') {
@@ -137,7 +136,6 @@ session.web.ActionManager = session.web.Widget.extend({
                 this.dialog = new session.web.Dialog(this, { width: '80%' });
                 if(on_close)
                     this.dialog.on_close.add(on_close);
-                this.dialog.start();
             } else {
                 this.dialog_viewmanager.stop();
             }
@@ -519,7 +517,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
                 }
             });
             if (!(self.action.id in self.session.hidden_menutips)) {
-                Users.read_ids([this.session.uid], ['menu_tips'], function(users) {
+                Users.read_ids([this.session.uid], ['menu_tips']).then(function(users) {
                     var user = users[0];
                     if (!(user && user.id === self.session.uid)) {
                         return;
@@ -918,7 +916,7 @@ session.web.TranslateDialog = session.web.Dialog.extend({
         this.languages = null;
         this.languages_loaded = $.Deferred();
         (new session.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(),
-            [['translatable', '=', '1']])).read_slice(['code', 'name'], { sort: 'id' }, this.on_languages_loaded);
+            [['translatable', '=', '1']])).read_slice(['code', 'name'], { sort: 'id' }).then(this.on_languages_loaded);
     },
     start: function() {
         var self = this;
diff --git a/addons/web_calendar/po/pt_BR.po b/addons/web_calendar/po/pt_BR.po
new file mode 100644 (file)
index 0000000..e9ef983
--- /dev/null
@@ -0,0 +1,34 @@
+# Brazilian Portuguese translation for openerp-web
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openerp-web package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openerp-web\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-12-20 18:48+0100\n"
+"PO-Revision-Date: 2012-01-10 11:02+0000\n"
+"Last-Translator: Rafael Sales <Unknown>\n"
+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-01-11 04:55+0000\n"
+"X-Generator: Launchpad (build 14640)\n"
+
+#: addons/web_calendar/static/src/js/calendar.js:11
+msgid "Calendar"
+msgstr ""
+
+#: addons/web_calendar/static/src/js/calendar.js:446
+msgid "Responsible"
+msgstr "Responsável"
+
+#: addons/web_calendar/static/src/js/calendar.js:475
+msgid "Navigator"
+msgstr ""
+
+#: addons/web_calendar/static/src/xml/web_calendar.xml:0
+msgid "&nbsp;"
+msgstr ""
index 26828b8..a5de664 100644 (file)
     float:right;
 }
 .openerp .dhx_cal_prev_button:hover, .openerp .dhx_cal_prev_button:active, .openerp .dhx_cal_today_button:hover, .openerp .dhx_cal_today_button:active, .openerp .dhx_cal_next_button:hover, .openerp .dhx_cal_next_button:active {
-
 }
 
 .openerp .dhx_mini_calendar .dhx_cal_prev_button, .openerp .dhx_mini_calendar .dhx_cal_next_button, .openerp .dhx_mini_calendar .dhx_cal_today_button {
index c9b5ab8..d27ec7e 100644 (file)
@@ -171,7 +171,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({
         }
     },
     reload_event: function(id) {
-        this.dataset.read_ids([id], _.keys(this.fields), this.on_events_loaded);
+        this.dataset.read_ids([id], _.keys(this.fields)).then(this.on_events_loaded);
     },
     get_color: function(key) {
         if (this.color_map[key]) {
@@ -392,7 +392,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({
                 offset: 0,
                 domain: self.get_range_domain(),
                 context: self.last_search[1]
-            }, function(events) {
+            }).then(function(events) {
                 self.dataset_events = events;
                 self.on_events_loaded(events);
             });
index 2ac6c68..ac5b15b 100644 (file)
@@ -296,8 +296,10 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({
                 '|', ['groups_id', '=', false],
                      ['groups_id', 'in', record['groups_id']]];
             return $.when(
-                self.dataset.read_slice(['state', 'action_id', 'category_id'],{
-                        domain: todos_filter }),
+                self.dataset.read_slice(
+                    ['state', 'action_id', 'category_id'],
+                    { domain: todos_filter }
+                ),
                 self.dataset.call('progress').pipe(
                         function (arg) { return arg; }, null))
         }, null).then(this.on_records_loaded);
@@ -373,8 +375,8 @@ openerp.web_dashboard.Widget = openerp.web.View.extend(/** @lends openerp.web_da
     },
     start: function () {
         this._super();
-        return new openerp.web.DataSet(this, 'res.widget').read_ids(
-                [this.widget_id], ['title'], this.on_widget_loaded);
+        var ds = new openerp.web.DataSet(this, 'res.widget');
+        return ds.read_ids([this.widget_id], ['title']).then(this.on_widget_loaded);
     },
     on_widget_loaded: function (widgets) {
         var widget = widgets[0];
@@ -403,7 +405,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({
         openerp.webclient.menu.do_hide_secondary();
         var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']];
         var ds = new openerp.web.DataSetSearch(this, 'ir.module.module',{},domain);
-        ds.read_slice(['id'], {}, function(result) {
+        ds.read_slice(['id']).then(function(result) {
             if(result.length) {
                 self.on_installed_database();
             } else {
@@ -418,7 +420,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({
     on_installed_database: function() {
         var self = this;
         var ds = new openerp.web.DataSetSearch(this, 'ir.ui.menu', null, [['parent_id', '=', false]]);
-        var r = ds.read_slice( ['name', 'web_icon_data', 'web_icon_hover_data', 'module'], {}, function (applications) {
+        var r = ds.read_slice( ['name', 'web_icon_data', 'web_icon_hover_data', 'module']).then(function (applications) {
             //// Create a matrix of 3*x applications
             //var rows = [];
             //while (applications.length) {
diff --git a/addons/web_graph/po/pt_BR.po b/addons/web_graph/po/pt_BR.po
new file mode 100644 (file)
index 0000000..a75c7c9
--- /dev/null
@@ -0,0 +1,22 @@
+# Brazilian Portuguese translation for openerp-web
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openerp-web package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openerp-web\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-12-20 18:48+0100\n"
+"PO-Revision-Date: 2012-01-10 11:03+0000\n"
+"Last-Translator: Rafael Sales <Unknown>\n"
+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-01-11 04:55+0000\n"
+"X-Generator: Launchpad (build 14640)\n"
+
+#: addons/web_graph/static/src/js/graph.js:19
+msgid "Graph"
+msgstr "Gráfico"
index 30a10ee..b7eed2d 100644 (file)
@@ -422,7 +422,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
             } else {
                 self.abscissa = self.first_field;
             }
-            return self.dataset.read_slice(self.list_fields(), {}, $.proxy(self, 'schedule_chart'));
+            return self.dataset.read_slice(self.list_fields()).then($.proxy(self, 'schedule_chart'));
         });
     },
 
index 00a63f8..5e5abfb 100644 (file)
@@ -162,7 +162,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
                 group_aggregates[value] = group.aggregates[key];
             });
             var dataset = new openerp.web.DataSetSearch(self, self.dataset.model, group.context, group.domain);
-            dataset.read_slice(self.fields_keys, {'domain': group.domain, 'context': group.context}, function(records) {
+            dataset.read_slice(self.fields_keys, {'domain': group.domain, 'context': group.context}).then(function(records) {
                 self.dataset.ids.push.apply(self.dataset.ids, dataset.ids);
                 groups_array[index] = new openerp.web_kanban.KanbanGroup(self, records, group_value, group_name, group_aggregates);
                 if (!remaining--) {
@@ -175,7 +175,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
     do_process_dataset: function(dataset) {
         var self = this;
         this.do_clear_groups();
-        this.dataset.read_slice(this.fields_keys, {}, function(records) {
+        this.dataset.read_slice(this.fields_keys).then(function(records) {
             var groups = [];
             while (records.length) {
                 for (var i = 0; i < self.default_nr_columns; i++) {
@@ -491,7 +491,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({
     },
     do_reload: function() {
         var self = this;
-        this.view.dataset.read_ids([this.id], this.view.fields_keys, function(records) {
+        this.view.dataset.read_ids([this.id], this.view.fields_keys).then(function(records) {
             if (records.length) {
                 self.set_record(records[0]);
                 self.do_render();
index 5675449..84eccd4 100644 (file)
@@ -27,7 +27,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
         }
         this.dataset = new openerp.web.DataSetSearch(this, model, null, null);
         var context = new openerp.web.CompoundContext(this.dataset.get_context());
-        this.dataset.read_slice([],{}, function (result) {
+        this.dataset.read_slice([]).then(function (result) {
             for (var i = 0; i < result.length; i++) {
                 if (result[i].id == id) {
                     self.datarecord = result[i];
@@ -73,7 +73,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
                 var list_ids = [];
                 var datasearch = new openerp.web.DataSetSearch(self, rel_field.relation, rel_field.context);
                 datasearch.domain=[['id', 'in', rel_ids]];
-                datasearch.read_slice(['name'], {context:rel_field.context, domain: datasearch.domain, limit:80}, function(listrec){
+                datasearch.read_slice(['name'], {context:rel_field.context, domain: datasearch.domain, limit:80}).then(function(listrec){
                     _.each(listrec, function(i) {
                         list_ids.push(i.id);
                     });
index e6bbfb1..7c7b7b3 100644 (file)
@@ -33,7 +33,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({
         var list_ids = [];
         var datasearch = new openerp.web.DataSetSearch(self, self.action.res_model,self.action.context);
         datasearch.domain = self.action.domain;
-        datasearch.read_slice(['name'], {context:datasearch.context, domain: datasearch.domain, limit:80}, function(listresult){
+        datasearch.read_slice(['name'], {context:datasearch.context, domain: datasearch.domain, limit:80}).then(function(listresult){
             _.each(listresult, function(i) {
                 list_ids.push(i.id);
             });
index 8d4396b..52a3d5c 100644 (file)
@@ -286,7 +286,7 @@ openerp.web_process = function (openerp) {
                         $(this).dialog('destroy');
                     }}
                 ]
-            }).start().open();
+            }).open();
 
             action_manager.appendTo(dialog.$element);
             action_manager.do_action({
index e032f88..ecf73e3 100644 (file)
@@ -40,7 +40,7 @@ instance.web_uservoice.UserVoice = instance.web.Widget.extend({
 
         var ds = new instance.web.DataSetSearch(this, 'ir.ui.menu', {lang: 'NO_LANG'}, [['parent_id', '=', false]]);
 
-        ds.read_slice(['name'], null, function(result) {
+        ds.read_slice(['name']).then(function(result) {
             _.each(result, function(menu) {
                 self.uservoiceForums[menu.id] = forum_mapping[menu.name.toLowerCase()] || self.default_forum;
             });