diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index fb6cded7c2d..a6b5fa63918 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -151,8 +151,15 @@ def ensure_db(redirect='/web/database/selector'): # may depend on data injected by the database route dispatcher. # Thus, we redirect the user to the same page but with the session cookie set. # This will force using the database route dispatcher... + r = request.httprequest + url_redirect = r.base_url + if r.query_string: + # Can't use werkzeug.wrappers.BaseRequest.url with encoded hashes: + # https://github.com/amigrave/werkzeug/commit/b4a62433f2f7678c234cdcac6247a869f90a7eb7 + url_redirect += '?' + r.query_string + response = werkzeug.utils.redirect(url_redirect, 302) request.session.db = db - abort_and_redirect(request.httprequest.url) + abort_and_redirect(url_redirect) # if db not provided, use the session one if not db: @@ -649,6 +656,9 @@ class Home(http.Controller): ensure_db() if request.session.uid: + if kw.get('redirect'): + return werkzeug.utils.redirect(kw.get('redirect'), 303) + headers = { 'Cache-Control': 'no-cache', 'Content-Type': 'text/html; charset=utf-8', @@ -661,6 +671,9 @@ class Home(http.Controller): def web_login(self, redirect=None, **kw): ensure_db() + if request.httprequest.method == 'GET' and redirect and request.session.uid: + return http.redirect_with_hash(redirect) + if not request.uid: request.uid = openerp.SUPERUSER_ID @@ -1202,11 +1215,14 @@ class DataSet(http.Controller): def _call_kw(self, model, method, args, kwargs): # Temporary implements future display_name special field for model#read() - if method == 'read' and kwargs.get('context', {}).get('future_display_name'): + if method in ('read', 'search_read') and kwargs.get('context', {}).get('future_display_name'): if 'display_name' in args[1]: - names = dict(request.session.model(model).name_get(args[0], **kwargs)) + if method == 'read': + names = dict(request.session.model(model).name_get(args[0], **kwargs)) + else: + names = dict(request.session.model(model).name_search('', args[0], **kwargs)) args[1].remove('display_name') - records = request.session.model(model).read(*args, **kwargs) + records = getattr(request.session.model(model), method)(*args, **kwargs) for record in records: record['display_name'] = \ names.get(record['id']) or "%s#%d" % (model, (record['id'])) @@ -1679,6 +1695,8 @@ class Export(http.Controller): for k, v in self.fields_info(model, export_fields).iteritems()) class ExportFormat(object): + raw_data = False + @property def content_type(self): """ Provides the format's content type """ @@ -1711,7 +1729,7 @@ class ExportFormat(object): ids = ids or Model.search(domain, 0, False, False, request.context) field_names = map(operator.itemgetter('name'), fields) - import_data = Model.export_data(ids, field_names, request.context).get('datas',[]) + import_data = Model.export_data(ids, field_names, self.raw_data, context=request.context).get('datas',[]) if import_compat: columns_headers = field_names @@ -1764,6 +1782,8 @@ class CSVExport(ExportFormat, http.Controller): return data class ExcelExport(ExportFormat, http.Controller): + # Excel needs raw data to correctly handle numbers and date values + raw_data = True @http.route('/web/export/xls', type='http', auth="user") @serialize_exception @@ -1785,14 +1805,20 @@ class ExcelExport(ExportFormat, http.Controller): worksheet.write(0, i, fieldname) worksheet.col(i).width = 8000 # around 220 pixels - style = xlwt.easyxf('align: wrap yes') + base_style = xlwt.easyxf('align: wrap yes') + date_style = xlwt.easyxf('align: wrap yes', num_format_str='YYYY-MM-DD') + datetime_style = xlwt.easyxf('align: wrap yes', num_format_str='YYYY-MM-DD HH:mm:SS') for row_index, row in enumerate(rows): for cell_index, cell_value in enumerate(row): + cell_style = base_style if isinstance(cell_value, basestring): cell_value = re.sub("\r", " ", cell_value) - if cell_value is False: cell_value = None - worksheet.write(row_index + 1, cell_index, cell_value, style) + elif isinstance(cell_value, datetime.datetime): + cell_style = datetime_style + elif isinstance(cell_value, datetime.date): + cell_style = date_style + worksheet.write(row_index + 1, cell_index, cell_value, cell_style) fp = StringIO() workbook.save(fp) diff --git a/addons/web/i18n/ar.po b/addons/web/i18n/ar.po index db34b4ff088..5e5a8ce1a37 100644 --- a/addons/web/i18n/ar.po +++ b/addons/web/i18n/ar.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web @@ -1849,7 +1849,7 @@ msgstr "الافتراضي" #: code:addons/web/static/src/xml/base.xml:468 #, python-format msgid "OpenERP" -msgstr "كروز" +msgstr "OpenERP" #. module: web #. openerp-web @@ -2213,7 +2213,7 @@ msgstr "زر" #: code:addons/web/static/src/xml/base.xml:440 #, python-format msgid "OpenERP is a trademark of the" -msgstr "كروز علامة تجارية ملك" +msgstr "OpenERP علامة تجارية ملك" #. module: web #. openerp-web @@ -2241,7 +2241,7 @@ msgstr "False" #: code:addons/web/static/src/xml/base.xml:426 #, python-format msgid "About OpenERP" -msgstr "حول كروز" +msgstr "حول OpenERP" #. module: web #. openerp-web diff --git a/addons/web/i18n/bg.po b/addons/web/i18n/bg.po index 423e372cb8a..61f70d3d28c 100644 --- a/addons/web/i18n/bg.po +++ b/addons/web/i18n/bg.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/bn.po b/addons/web/i18n/bn.po index 76df35e4e41..90d942a69bf 100644 --- a/addons/web/i18n/bn.po +++ b/addons/web/i18n/bn.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/bs.po b/addons/web/i18n/bs.po index 9c1a9d1022f..e3a9041fd9b 100644 --- a/addons/web/i18n/bs.po +++ b/addons/web/i18n/bs.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ca.po b/addons/web/i18n/ca.po index 7a1b4d7c461..8e87e57e26b 100644 --- a/addons/web/i18n/ca.po +++ b/addons/web/i18n/ca.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/cs.po b/addons/web/i18n/cs.po index 095c53828f0..b3fdfe441eb 100644 --- a/addons/web/i18n/cs.po +++ b/addons/web/i18n/cs.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" "X-Poedit-Language: Czech\n" diff --git a/addons/web/i18n/da.po b/addons/web/i18n/da.po index 548cadd8e03..517a7a50fec 100644 --- a/addons/web/i18n/da.po +++ b/addons/web/i18n/da.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/de.po b/addons/web/i18n/de.po index 819dd1dda10..c62ed6c6002 100644 --- a/addons/web/i18n/de.po +++ b/addons/web/i18n/de.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/en_AU.po b/addons/web/i18n/en_AU.po index eda8146e2b3..5b2cd646c26 100644 --- a/addons/web/i18n/en_AU.po +++ b/addons/web/i18n/en_AU.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/en_GB.po b/addons/web/i18n/en_GB.po index bd0b3398fd4..c501a89d053 100644 --- a/addons/web/i18n/en_GB.po +++ b/addons/web/i18n/en_GB.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es.po b/addons/web/i18n/es.po index 4c02281544e..007e5d4a0aa 100644 --- a/addons/web/i18n/es.po +++ b/addons/web/i18n/es.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es_CL.po b/addons/web/i18n/es_CL.po index c64879982dc..629a8471cb9 100644 --- a/addons/web/i18n/es_CL.po +++ b/addons/web/i18n/es_CL.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es_CR.po b/addons/web/i18n/es_CR.po index 53d4bfac330..b36c5ac297a 100644 --- a/addons/web/i18n/es_CR.po +++ b/addons/web/i18n/es_CR.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" "Language: es\n" diff --git a/addons/web/i18n/es_DO.po b/addons/web/i18n/es_DO.po index 41a5ebdea78..63c8f8016fa 100644 --- a/addons/web/i18n/es_DO.po +++ b/addons/web/i18n/es_DO.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es_EC.po b/addons/web/i18n/es_EC.po index 0f0034fa0ad..e67b8a8fabc 100644 --- a/addons/web/i18n/es_EC.po +++ b/addons/web/i18n/es_EC.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:09+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es_MX.po b/addons/web/i18n/es_MX.po index 2437e467ff4..687127766c6 100644 --- a/addons/web/i18n/es_MX.po +++ b/addons/web/i18n/es_MX.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:09+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/es_PE.po b/addons/web/i18n/es_PE.po index 7f2c94bc45b..eb800a4325d 100644 --- a/addons/web/i18n/es_PE.po +++ b/addons/web/i18n/es_PE.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:09+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/et.po b/addons/web/i18n/et.po index 22c95f85d36..4ea1790dea8 100644 --- a/addons/web/i18n/et.po +++ b/addons/web/i18n/et.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/eu.po b/addons/web/i18n/eu.po index 146e189f42e..2669aa49232 100644 --- a/addons/web/i18n/eu.po +++ b/addons/web/i18n/eu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/fa.po b/addons/web/i18n/fa.po index a0881fccb62..cb38ee33a87 100644 --- a/addons/web/i18n/fa.po +++ b/addons/web/i18n/fa.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/fi.po b/addons/web/i18n/fi.po index c8c03c42b83..a204fbd5123 100644 --- a/addons/web/i18n/fi.po +++ b/addons/web/i18n/fi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/fr.po b/addons/web/i18n/fr.po index 63e1d7641b7..4931b2b8d98 100644 --- a/addons/web/i18n/fr.po +++ b/addons/web/i18n/fr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/fr_CA.po b/addons/web/i18n/fr_CA.po index 8db5cbc378f..4404d67ca83 100644 --- a/addons/web/i18n/fr_CA.po +++ b/addons/web/i18n/fr_CA.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/gl.po b/addons/web/i18n/gl.po index 429ed7d8410..6e5575e6e11 100644 --- a/addons/web/i18n/gl.po +++ b/addons/web/i18n/gl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/gu.po b/addons/web/i18n/gu.po index 54316a9182b..a35db11020e 100644 --- a/addons/web/i18n/gu.po +++ b/addons/web/i18n/gu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/he.po b/addons/web/i18n/he.po index 48773ec1299..20543b55edb 100644 --- a/addons/web/i18n/he.po +++ b/addons/web/i18n/he.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/hi.po b/addons/web/i18n/hi.po index 212c50f7c53..b3e01ff20de 100644 --- a/addons/web/i18n/hi.po +++ b/addons/web/i18n/hi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/hr.po b/addons/web/i18n/hr.po index c9f970acf8e..37290aae865 100644 --- a/addons/web/i18n/hr.po +++ b/addons/web/i18n/hr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/hu.po b/addons/web/i18n/hu.po index c0fcb1f3238..8742722d942 100644 --- a/addons/web/i18n/hu.po +++ b/addons/web/i18n/hu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/id.po b/addons/web/i18n/id.po index e60a0546190..02004635c53 100644 --- a/addons/web/i18n/id.po +++ b/addons/web/i18n/id.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/it.po b/addons/web/i18n/it.po index b73f9f24fc5..b434c89622f 100644 --- a/addons/web/i18n/it.po +++ b/addons/web/i18n/it.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ja.po b/addons/web/i18n/ja.po index 5805f935695..a511b55d48d 100644 --- a/addons/web/i18n/ja.po +++ b/addons/web/i18n/ja.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ka.po b/addons/web/i18n/ka.po index fc232fb2dd0..6dd7bc6944a 100644 --- a/addons/web/i18n/ka.po +++ b/addons/web/i18n/ka.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ko.po b/addons/web/i18n/ko.po index da4357fc60b..f57bebe41c9 100644 --- a/addons/web/i18n/ko.po +++ b/addons/web/i18n/ko.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/lo.po b/addons/web/i18n/lo.po index eda66545fa6..846531700ce 100644 --- a/addons/web/i18n/lo.po +++ b/addons/web/i18n/lo.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/lt.po b/addons/web/i18n/lt.po index e2a842ef239..6c01b2b2419 100644 --- a/addons/web/i18n/lt.po +++ b/addons/web/i18n/lt.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/lv.po b/addons/web/i18n/lv.po index fde422c8c73..8110776c2b1 100644 --- a/addons/web/i18n/lv.po +++ b/addons/web/i18n/lv.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/mk.po b/addons/web/i18n/mk.po index fb202b527c7..62931213284 100644 --- a/addons/web/i18n/mk.po +++ b/addons/web/i18n/mk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/mn.po b/addons/web/i18n/mn.po index a3faf28c9ef..f174e802b48 100644 --- a/addons/web/i18n/mn.po +++ b/addons/web/i18n/mn.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web @@ -2334,7 +2334,7 @@ msgstr "'%s' нь хөрвүүлэх боломжгүй огноо, огнооц #: code:addons/web/static/src/xml/base.xml:325 #, python-format msgid "Duplicate" -msgstr "Хувилах" +msgstr "Хуулбарлан үүсгэх" #. module: web #. openerp-web diff --git a/addons/web/i18n/nb.po b/addons/web/i18n/nb.po index 9cfbd2abb39..6fb11986ced 100644 --- a/addons/web/i18n/nb.po +++ b/addons/web/i18n/nb.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/nl.po b/addons/web/i18n/nl.po index df579aae021..097da74a70b 100644 --- a/addons/web/i18n/nl.po +++ b/addons/web/i18n/nl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:08+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:07+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/nl_BE.po b/addons/web/i18n/nl_BE.po index 1e4825c91cf..8c1b69be4a5 100644 --- a/addons/web/i18n/nl_BE.po +++ b/addons/web/i18n/nl_BE.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/pl.po b/addons/web/i18n/pl.po index e46855162b3..91944a71228 100644 --- a/addons/web/i18n/pl.po +++ b/addons/web/i18n/pl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/pt.po b/addons/web/i18n/pt.po index e37c4848313..7f297795c26 100644 --- a/addons/web/i18n/pt.po +++ b/addons/web/i18n/pt.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/pt_BR.po b/addons/web/i18n/pt_BR.po index 212785b4165..c8d7b8529df 100644 --- a/addons/web/i18n/pt_BR.po +++ b/addons/web/i18n/pt_BR.po @@ -15,7 +15,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ro.po b/addons/web/i18n/ro.po index f056d09a3e3..4fc6cdc68e1 100644 --- a/addons/web/i18n/ro.po +++ b/addons/web/i18n/ro.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/ru.po b/addons/web/i18n/ru.po index 237acd3e0f6..36a5ed7405e 100644 --- a/addons/web/i18n/ru.po +++ b/addons/web/i18n/ru.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:09+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/sk.po b/addons/web/i18n/sk.po index d909efec36c..6f099967ac8 100644 --- a/addons/web/i18n/sk.po +++ b/addons/web/i18n/sk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/sl.po b/addons/web/i18n/sl.po index a88bbf7daf1..06dfea9c0d6 100644 --- a/addons/web/i18n/sl.po +++ b/addons/web/i18n/sl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/sq.po b/addons/web/i18n/sq.po index 3d6fda95236..779a6da4f83 100644 --- a/addons/web/i18n/sq.po +++ b/addons/web/i18n/sq.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:07+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:06+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/sr@latin.po b/addons/web/i18n/sr@latin.po index 5b34291ded2..9e13eea02e6 100644 --- a/addons/web/i18n/sr@latin.po +++ b/addons/web/i18n/sr@latin.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:09+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/sv.po b/addons/web/i18n/sv.po index 6ff6fae0ecb..a1db4aa24d3 100644 --- a/addons/web/i18n/sv.po +++ b/addons/web/i18n/sv.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/th.po b/addons/web/i18n/th.po index 2dd297df24b..760deabbc6f 100644 --- a/addons/web/i18n/th.po +++ b/addons/web/i18n/th.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/tr.po b/addons/web/i18n/tr.po index 769ee2bf353..268fba0b4e3 100644 --- a/addons/web/i18n/tr.po +++ b/addons/web/i18n/tr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/uk.po b/addons/web/i18n/uk.po index 4fd02130ca9..6cf0c338d64 100644 --- a/addons/web/i18n/uk.po +++ b/addons/web/i18n/uk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/vi.po b/addons/web/i18n/vi.po index bca4db09747..9bf365fad54 100644 --- a/addons/web/i18n/vi.po +++ b/addons/web/i18n/vi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:10+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/zh_CN.po b/addons/web/i18n/zh_CN.po index 7e884a20c60..cea73c2cfbe 100644 --- a/addons/web/i18n/zh_CN.po +++ b/addons/web/i18n/zh_CN.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/i18n/zh_TW.po b/addons/web/i18n/zh_TW.po index 2b68332b537..7de6b0f0af6 100644 --- a/addons/web/i18n/zh_TW.po +++ b/addons/web/i18n/zh_TW.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-24 06:11+0000\n" +"X-Launchpad-Export-Date: 2014-04-01 06:08+0000\n" "X-Generator: Launchpad (build 16967)\n" #. module: web diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 3996579e02a..5469c5376b0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -368,6 +368,7 @@ .openerp .oe_left { float: left; margin-right: 8px; + width: 305px; } .openerp .oe_right { float: right; @@ -456,11 +457,46 @@ background: #ed6f6a; } .openerp .oe_button_box { - width: 270px; - text-align: right; + width: 400px; + text-align: left; } -.openerp .oe_button_box button { - margin: 4px; +.openerp .oe_button_box .oe_stat_button:hover { + background: #7c7bad; + color: white; +} +.openerp .oe_button_box .oe_stat_button:hover .fa { + color: white; +} +.openerp .oe_button_box .oe_stat_button { + font-weight: normal; + display: inline-table; + width: 33% !important; + height: 42px; + margin: 0px -1px -1px 0px; + padding: 0; + color: #666666; + border: 1px solid #dddddd; + border-radius: 0; + box-shadow: none; + background: white; +} +.openerp .oe_button_box .oe_stat_button > div { + display: table-cell; + vertical-align: middle; + text-align: left; + padding: 0; + line-height: 120%; +} +.openerp .oe_button_box .oe_stat_button .stat_button_icon { + color: #7c7bad; + font-size: 24px; + padding: 0px 3px; + width: 37px; + text-align: center; +} +.openerp .oe_button_box .oe_stat_button svg { + width: 38px; + height: 38px; } .openerp .oe_avatar > img { max-height: 90px; @@ -1248,12 +1284,14 @@ width: 100%; } .openerp .oe_view_manager .oe_view_manager_body { - display: table-row; height: inherit; } .openerp .oe_view_manager .oe_view_manager_view_kanban:not(:empty) { height: inherit; } +.openerp .oe_view_manager[data-view-type=kanban] .oe_view_manager_body { + display: table-row; +} .openerp .oe_view_manager table.oe_view_manager_header { border-collapse: separate; width: 100%; @@ -2362,6 +2400,7 @@ } .openerp .oe_hidden_input_file { position: relative; + overflow-x: hidden; } .openerp .oe_hidden_input_file input.oe_form_binary_file { z-index: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index b08427e0832..65f22a89481 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -385,6 +385,7 @@ $sheet-padding: 16px .oe_left float: left margin-right: 8px + width: 305px .oe_right float: right margin-left: 8px @@ -429,10 +430,40 @@ $sheet-padding: 16px &:hover background: #ED6F6A .oe_button_box - width: 270px - text-align: right - button - margin: 4px + width: 400px + text-align: left + .oe_stat_button:hover + background: #7c7bad + color: white + .fa + color: white + .oe_stat_button + font-weight: normal + display: inline-table + width: 33% !important + height: 42px + margin: 0px -1px -1px 0px + padding: 0 + color: #666 + border: 1px solid #dddddd + border-radius: 0 + box-shadow: none + background: white + > div + display: table-cell + vertical-align: middle + text-align: left + padding: 0 + line-height: 120% + .stat_button_icon + color: #7C7BAD + font-size: 24px + padding: 0px 3px + width: 37px + text-align: center + svg + width: 38px + height: 38px .oe_avatar > img max-height: 90px @@ -1037,10 +1068,12 @@ $sheet-padding: 16px height: inherit width: 100% .oe_view_manager_body - display: table-row height: inherit .oe_view_manager_view_kanban:not(:empty) height: inherit + &[data-view-type=kanban] + .oe_view_manager_body + display: table-row table.oe_view_manager_header border-collapse: separate @@ -1920,6 +1953,7 @@ $sheet-padding: 16px // Position: relative is used for the hidden input[type=file] // Do not remove it anymore ! position: relative + overflow-x: hidden input.oe_form_binary_file z-index: 0 line-height: 0 diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 8e5df84e2c3..de56927799e 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -105,9 +105,6 @@ instance.web.Dialog = instance.web.Widget.extend({ autoOpen: false, position: [false, 40], buttons: null, - beforeClose: function () { - self.trigger("closing"); - }, resizeStop: function() { self.trigger("resized"); }, @@ -208,8 +205,9 @@ instance.web.Dialog = instance.web.Widget.extend({ /** Closes the popup, if destroy_on_close was passed to the constructor, it is also destroyed. */ - close: function() { + close: function(reason) { if (this.dialog_inited && this.$el.is(":data(dialog)")) { + this.trigger("closing", reason); this.$el.dialog('close'); } }, @@ -225,14 +223,14 @@ instance.web.Dialog = instance.web.Widget.extend({ /** Destroys the popup, also closes it. */ - destroy: function () { + destroy: function (reason) { this.$buttons.remove(); _.each(this.getChildren(), function(el) { el.destroy(); }); if (! this.__tmp_dialog_closing) { this.__tmp_dialog_destroying = true; - this.close(); + this.close(reason); this.__tmp_dialog_destroying = undefined; } if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) { @@ -256,7 +254,7 @@ instance.web.CrashManager = instance.web.Class.extend({ new (handler)(this, error).display(); return; } - if (error.data.name === "openerp.http.SessionExpiredException") { + if (error.data.name === "openerp.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") { this.show_warning({type: "Session Expired", data: { message: _t("Your OpenERP session expired. Please refresh the current web page.") }}); return; } @@ -1264,9 +1262,9 @@ instance.web.WebClient = instance.web.Client.extend({ }; self.action_manager.do_action(result); var form = self.action_manager.dialog_widget.views.form.controller; - form.on("on_button_cancel", self.action_manager.dialog, self.action_manager.dialog.close); + form.on("on_button_cancel", self.action_manager, self.action_manager.dialog_stop); form.on('record_saved', self, function() { - self.action_manager.dialog.close(); + self.action_manager.dialog_stop(); self.update_logo(); }); }); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index b92ca1d3ba5..90c84ba9cda 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -271,7 +271,12 @@ instance.web.Session.include( /** @lends instance.web.Session# */{ for(var i=0; i"; this._super(field_manager, node); this.force_disabled = false; this.string = (this.node.attrs.string || '').replace(/_/g, ''); @@ -1976,11 +1991,12 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ var self = this; var context = this.build_context(); - return this.view.do_execute_action( _.extend({}, this.node.attrs, {context: context}), - this.view.dataset, this.view.datarecord.id, function () { - self.view.recursive_reload(); + this.view.dataset, this.view.datarecord.id, function (reason) { + if (!_.isObject(reason)) { + self.view.recursive_reload(); + } }); }, check_disable: function() { @@ -2253,7 +2269,7 @@ instance.web.form.ReinitializeFieldMixin = _.extend({}, instance.web.form.Reini /** Some hack to make placeholders work in ie9. */ -if ($.browser.msie && $.browser.version === "9.0") { +if (!('placeholder' in document.createElement('input'))) { document.addEventListener("DOMNodeInserted",function(event){ var nodename = event.target.nodeName.toLowerCase(); if ( nodename === "input" || nodename == "textarea" ) { @@ -2805,6 +2821,50 @@ instance.web.form.FieldProgressBar = instance.web.form.AbstractField.extend({ } }); +/** + The PercentPie field expect a float from 0 to 100. +*/ +instance.web.form.FieldPercentPie = instance.web.form.AbstractField.extend({ + template: 'FieldPercentPie', + + render_value: function() { + var value = this.get('value'), + formatted_value = Math.round(value || 0) + '%', + svg = this.$('svg')[0]; + + svg.innerHTML = ""; + nv.addGraph(function() { + var size=43; + var chart = nv.models.pieChart() + .width(size) + .height(size) + .margin({top: 0, right: 0, bottom: 0, left: 0}) + .donut(true) + .showLegend(false) + .showLabels(false) + .tooltips(false) + .color(['#7C7BAD','#DDD']) + .donutRatio(0.62); + + d3.select(svg) + .datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}]) + .transition() + .call(chart) + .attr({width:size, height:size}); + + d3.select(svg) + .append("text") + .attr({x: size/2, y: size/2 + 3, 'text-anchor': 'middle'}) + .style({"font-size": "10px", "font-weight": "bold"}) + .text(formatted_value); + + return chart; + }); + + } +}); + + instance.web.form.FieldSelection = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, { template: 'FieldSelection', @@ -5851,6 +5911,26 @@ instance.web.form.X2ManyCounter = instance.web.form.AbstractField.extend(instanc } }); +/** + This widget is intended to be used on stat button numeric fields. It will display + the value many2many and one2many. It is a read-only field that will + display a simple string "