From 0a71d06be3909cfde8e3bd41752af2ba84dae023 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 12 Mar 2014 14:22:13 +0100 Subject: [PATCH 01/22] [IMP] work in progress on stats buttons. The goal is to allow buttons with dynamic/statistical informations in form views (addon web) bzr revid: ged@openerp.com-20140312132213-hclaw6jc87u220zq --- addons/web/static/src/css/base.css | 17 ++++++++++++ addons/web/static/src/css/base.sass | 14 ++++++++++ addons/web/static/src/js/view_form.js | 37 +++++++++++++++++++++++++-- addons/web/static/src/xml/base.xml | 10 ++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index e43a2fb654e..263a867390e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -462,6 +462,23 @@ .openerp .oe_button_box button { margin: 4px; } +.openerp .oe_button_box .oe_stat_button { + font-weight: normal; + display: inline-table; + width: 48% !important; + height: 45px; + margin: 1px; +} +.openerp .oe_button_box .oe_stat_button > div { + display: table-cell; + vertical-align: middle; + padding: 0; +} +.openerp .oe_button_box .oe_stat_button .stat_button_icon { + color: #7c7bad; + font-size: 24px; + padding: 4px; +} .openerp .oe_avatar > img { max-height: 90px; max-width: 90px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index b19db9e4ebd..2d5ae82135e 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -433,6 +433,20 @@ $sheet-padding: 16px text-align: right button margin: 4px + .oe_stat_button + font-weight: normal + display: inline-table + width: 48% !important + height: 45px + margin: 1px + > div + display: table-cell + vertical-align: middle + padding: 0 + .stat_button_icon + color: #7C7BAD + font-size: 24px + padding: 4px .oe_avatar > img max-height: 90px diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index f1fc377fa94..a8973d760fa 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1218,6 +1218,9 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt $('button', doc).each(function() { $(this).attr('data-button-type', $(this).attr('type')).attr('type', 'button'); }); + $('statbutton', doc).each(function() { + $(this).attr('data-button-type', $(this).attr('type')).attr('type', 'button'); + }); // IE's html parser is also a css parser. How convenient... $('board', doc).each(function() { $(this).attr('layout', $(this).attr('style')); @@ -1277,6 +1280,9 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt var defs = []; _.each(this.to_replace, function(el) { defs.push(el[0].replace(el[1])); + if (el[1].children().length) { + el[0].$el.append(el[1].children()); + } }); this.to_replace = []; return $.when.apply($, defs); @@ -1304,7 +1310,7 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt var tagname = $tag[0].nodeName.toLowerCase(); if (this.tags_registry.contains(tagname)) { this.tags_to_init.push($tag); - return $tag; + return (tagname === 'statbutton') ? this.process_statbutton($tag) : $tag; } var fn = self['process_' + tagname]; if (fn) { @@ -1321,6 +1327,17 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt return $tag; } }, + process_statbutton: function ($button) { + var self = this; + console.log('yenrst'); + if ($button.children().length) { + $button.children().each(function() { + self.process($(this)); + }); + } + return $button; + }, + process_widget: function($widget) { this.widgets_to_init.push($widget); return $widget; @@ -1976,7 +1993,6 @@ 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 () { @@ -1990,6 +2006,22 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ } }); +instance.web.form.StatButton = instance.web.form.WidgetButton.extend({ + template: 'StatButton', + + init: function(field_manager, node) { + var icon = node.attrs.icon; + this._super(field_manager, node); + + // debugger; + if (icon) { + this.icon = ""; + } + + }, + +}); + /** * Interface to be implemented by fields. * @@ -5899,6 +5931,7 @@ instance.web.form.widgets = new instance.web.Registry({ */ instance.web.form.tags = new instance.web.Registry({ 'button' : 'instance.web.form.WidgetButton', + 'statbutton' : 'instance.web.form.StatButton', }); instance.web.form.custom_widgets = new instance.web.Registry({ diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 80b82c1f40b..fa96fe1ac8a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1360,6 +1360,16 @@ + + +
From ee478106748e52b314ac80a69d34a9b50cc29e4f Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 12 Mar 2014 14:45:38 +0100 Subject: [PATCH 02/22] [IMP] css tweaks to stat buttons bzr revid: ged@openerp.com-20140312134538-7b3o22lakb8qk45a --- addons/web/static/src/css/base.css | 3 ++- addons/web/static/src/css/base.sass | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 263a867390e..524bd79cc52 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -467,7 +467,8 @@ display: inline-table; width: 48% !important; height: 45px; - margin: 1px; + margin: 0px; + color: #666666; } .openerp .oe_button_box .oe_stat_button > div { display: table-cell; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 2d5ae82135e..f81232b7ee8 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -438,7 +438,8 @@ $sheet-padding: 16px display: inline-table width: 48% !important height: 45px - margin: 1px + margin: 0px + color: #666 > div display: table-cell vertical-align: middle From d2637811dec84306ab80cc49f40a8b823d7984a6 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Thu, 13 Mar 2014 13:48:43 +0100 Subject: [PATCH 03/22] [IMP] adds PercentPie and X2Many widgets to formview. PercentPie takes a field 'float' and displays a read-only pie chart to visualize the corresponding percent. X2Many takes a 1tomany or a manytomany field and display a read only string '
- - - - + + + + + + @@ -1945,7 +1947,7 @@ - +
From af61fd53bc86583aca872d4d884e976fed885d30 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Fri, 14 Mar 2014 15:21:55 +0100 Subject: [PATCH 07/22] [IMP] removes the tooltip when mouse hovers over a 'percentpie' widget (addon web) bzr revid: ged@openerp.com-20140314142155-u8suij5tikxwd0zi --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index dcb15d3d16d..c4bddd90f34 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2837,6 +2837,7 @@ instance.web.form.FieldPercentPie = instance.web.form.AbstractField.extend({ .donut(true) .showLegend(false) .showLabels(false) + .tooltips(false) .color(['#7C7BAD','#DDD']) .donutRatio(0.62); From e8198d74b68c3f1fba677b596a2eedf60af8ad83 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Mon, 17 Mar 2014 16:27:10 +0100 Subject: [PATCH 08/22] [IMP] various tweaks to stat_button, to fix issues mentioned in code review. This is mostly cosmetic cleanups, only notable change is that stat_button is now a proper html button instead of a label (addon web) bzr revid: ged@openerp.com-20140317152710-c33q8kua33o001la --- addons/web/static/src/css/base.css | 9 +++++--- addons/web/static/src/css/base.sass | 10 +++++---- addons/web/static/src/js/view_form.js | 16 ++++++-------- addons/web/static/src/xml/base.xml | 31 +++++++++------------------ 4 files changed, 28 insertions(+), 38 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 0b432d0c145..1d843e7e250 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -460,6 +460,9 @@ width: 400px; text-align: left; } +.openerp .oe_button_box .oe_stat_button:hover { + background: #dddddd; +} .openerp .oe_button_box .oe_stat_button { font-weight: normal; display: inline-table; @@ -467,7 +470,8 @@ height: 45px; margin: 0px -1px -1px 0px; color: #666666; - border-color: #dddddd; + border: 1px solid #666666; + background: white; } .openerp .oe_button_box .oe_stat_button > div { display: table-cell; @@ -478,9 +482,8 @@ .openerp .oe_button_box .oe_stat_button .stat_button_icon { color: #7c7bad; font-size: 24px; - padding: 0px; + padding: 0px 3px; text-align: center; - width: 40px; } .openerp .oe_button_box .oe_stat_button svg { width: 38px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 336f583e019..cca0deb4a1f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -432,6 +432,8 @@ $sheet-padding: 16px .oe_button_box width: 400px text-align: left + .oe_stat_button:hover + background: #ddd .oe_stat_button font-weight: normal display: inline-table @@ -439,18 +441,18 @@ $sheet-padding: 16px height: 45px margin: 0px -1px -1px 0px color: #666 - border-color: #ddd + border: 1px solid #666 + background: white > div display: table-cell vertical-align: middle text-align: left - padding: 0 + padding: 0 .stat_button_icon color: #7C7BAD font-size: 24px - padding: 0px + padding: 0px 3px text-align: center - width: 40px svg width: 38px height: 38px diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c4bddd90f34..969e0150737 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1916,8 +1916,8 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ template: 'WidgetButton', init: function(field_manager, node) { node.attrs.type = node.attrs['data-button-type']; - this.is_stat_button = node.attrs.class ? _.include(node.attrs.class.split(' '), 'oe_stat_button') : false; - this.icon = ""; + this.is_stat_button = /\boe_stat_button\b/.test(node.attrs['class']); + this.icon = node.attrs.icon && ""; this._super(field_manager, node); this.force_disabled = false; this.string = (this.node.attrs.string || '').replace(/_/g, ''); @@ -2845,16 +2845,12 @@ instance.web.form.FieldPercentPie = instance.web.form.AbstractField.extend({ .datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}]) .transition() .call(chart) - .attr('width', size) - .attr('height',size); + .attr({width:size, height:size}); d3.select(svg) .append("text") - .attr("x", size/2) - .attr("y", size/2 + 3) - .style("font-size", "10px") - .style("font-weight", "bold") - .attr("text-anchor", "middle") + .attr({x: size/2, y: size/2 + 3, 'text-anchor': 'middle'}) + .style({"font-size": "10px", "font-weight": "bold"}) .text(formatted_value); return chart; @@ -5923,7 +5919,7 @@ instance.web.form.StatInfo = instance.web.form.AbstractField.extend({ }, render_value: function() { var text = _.str.sprintf("%d %s", this.get("value") || 0, this.string); - this.$().html(QWeb.render("StatInfo", {text: text})); + this.$el.html(QWeb.render("StatInfo", {text: text})); }, }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b24bd8642cc..cc56dc2de13 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1189,7 +1189,7 @@
- + @@ -1356,26 +1356,15 @@
- - - - - - + From 373cb908caf5792367e49050e3d4ae086a097d0c Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Tue, 18 Mar 2014 09:55:25 +0100 Subject: [PATCH 09/22] [FIX] correctly handle the case where a 'stat button' has a string attribute (it needs to be displayed in a div instead of a span) (addon web) bzr revid: ged@openerp.com-20140318085525-vllzeycht9841g41 --- addons/web/static/src/xml/base.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index cc56dc2de13..508c507d935 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1362,11 +1362,11 @@ t-att-autofocus="widget.node.attrs.autofocus" t-att-accesskey="widget.node.attrs.accesskey"> -
- +
+ +
-
- +
From f4cfed3f0e89f8841b16ad578dd2c360f01d18ec Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 19 Mar 2014 09:57:18 +0100 Subject: [PATCH 10/22] [IMP] improves the look of the stat buttons in form view: the statinfo widget displays the information on two lines, the padding/margin/width have been adjusted. (addon web) bzr revid: ged@openerp.com-20140319085718-9v1l3pb43ee6qws6 --- addons/web/static/src/css/base.css | 14 +++++++++++--- addons/web/static/src/css/base.sass | 13 ++++++++++--- addons/web/static/src/js/view_form.js | 9 ++++++--- addons/web/static/src/xml/base.xml | 5 ++--- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 1d843e7e250..53043f2f4c5 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -461,16 +461,22 @@ text-align: left; } .openerp .oe_button_box .oe_stat_button:hover { - background: #dddddd; + 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: 45px; + height: 42px; margin: 0px -1px -1px 0px; + padding: 0; color: #666666; - border: 1px solid #666666; + border: 1px solid #dddddd; + border-radius: 0; background: white; } .openerp .oe_button_box .oe_stat_button > div { @@ -478,11 +484,13 @@ 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 { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cca0deb4a1f..466f60fa861 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -433,25 +433,32 @@ $sheet-padding: 16px width: 400px text-align: left .oe_stat_button:hover - background: #ddd + background: #7c7bad + color: white + .fa + color: white .oe_stat_button font-weight: normal display: inline-table width: 33% !important - height: 45px + height: 42px margin: 0px -1px -1px 0px + padding: 0 color: #666 - border: 1px solid #666 + border: 1px solid #dddddd + border-radius: 0 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 diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 969e0150737..5840d718bf8 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1917,7 +1917,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ init: function(field_manager, node) { node.attrs.type = node.attrs['data-button-type']; this.is_stat_button = /\boe_stat_button\b/.test(node.attrs['class']); - this.icon = node.attrs.icon && ""; + this.icon = node.attrs.icon && ""; this._super(field_manager, node); this.force_disabled = false; this.string = (this.node.attrs.string || '').replace(/_/g, ''); @@ -5918,8 +5918,11 @@ instance.web.form.StatInfo = instance.web.form.AbstractField.extend({ this.set("value", 0); }, render_value: function() { - var text = _.str.sprintf("%d %s", this.get("value") || 0, this.string); - this.$el.html(QWeb.render("StatInfo", {text: text})); + var options = { + value: this.get("value") || 0, + text: this.string, + }; + this.$el.html(QWeb.render("StatInfo", options)); }, }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 508c507d935..e35d0c977b3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1362,7 +1362,7 @@ t-att-autofocus="widget.node.attrs.autofocus" t-att-accesskey="widget.node.attrs.accesskey"> -
+
@@ -1937,6 +1937,5 @@
-
-
+
From 3a0fb1803547c081e90b44bbe4b8e78a32aa3d23 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Thu, 20 Mar 2014 09:21:29 +0100 Subject: [PATCH 11/22] [IMP] removes the shadow in stat buttons, to give them the 'flat' look (addon web) bzr revid: ged@openerp.com-20140320082129-o9jrdb962uuso4kb --- addons/web/static/src/css/base.css | 3 ++- addons/web/static/src/css/base.sass | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 0bf5a2d437e..66bfaca7c6e 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"); @@ -477,6 +477,7 @@ color: #666666; border: 1px solid #dddddd; border-radius: 0; + box-shadow: none; background: white; } .openerp .oe_button_box .oe_stat_button > div { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e6749747021..7110349557a 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -447,6 +447,7 @@ $sheet-padding: 16px color: #666 border: 1px solid #dddddd border-radius: 0 + box-shadow: none background: white > div display: table-cell From 6243d1885239961846f499f6cf8ef27dc2a7d9fe Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 31 Mar 2014 17:17:49 +0200 Subject: [PATCH 12/22] [FIX] export: Excel data should be in raw format to be handle correctly lp bug: https://launchpad.net/bugs/844569 fixed bzr revid: mat@openerp.com-20140331151749-cx333j01f1hw5ya8 --- addons/web/controllers/main.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index fb6cded7c2d..21e27a63d08 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -32,7 +32,7 @@ except ImportError: import openerp import openerp.modules.registry from openerp.tools.translate import _ -from openerp import http +from openerp import http, tools from openerp.http import request, serialize_exception as _serialize_exception @@ -1679,6 +1679,8 @@ class Export(http.Controller): for k, v in self.fields_info(model, export_fields).iteritems()) class ExportFormat(object): + raw_data = True + @property def content_type(self): """ Provides the format's content type """ @@ -1711,7 +1713,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 +1766,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 +1789,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=tools.DEFAULT_SERVER_DATE_FORMAT) + datetime_style = xlwt.easyxf('align: wrap yes', num_format_str=tools.DEFAULT_SERVER_DATETIME_FORMAT) 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.date): + cell_style = date_style + elif isinstance(cell_value, datetime.datetime): + cell_style = datetime_style + worksheet.write(row_index + 1, cell_index, cell_value, cell_style) fp = StringIO() workbook.save(fp) From a85d1168725feda5b8ebfa04af028c8c5be1cdec Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 1 Apr 2014 12:07:52 +0200 Subject: [PATCH 13/22] [FIX] default is False, style format is different than DEFAULT_SERVER_DATE{TIME}_FORMAT, datetime is instance of date bzr revid: mat@openerp.com-20140401100752-twixfgj2gmggy922 --- addons/web/controllers/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 21e27a63d08..8e52cb64717 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1679,7 +1679,7 @@ class Export(http.Controller): for k, v in self.fields_info(model, export_fields).iteritems()) class ExportFormat(object): - raw_data = True + raw_data = False @property def content_type(self): @@ -1790,18 +1790,18 @@ class ExcelExport(ExportFormat, http.Controller): worksheet.col(i).width = 8000 # around 220 pixels base_style = xlwt.easyxf('align: wrap yes') - date_style = xlwt.easyxf('align: wrap yes', num_format_str=tools.DEFAULT_SERVER_DATE_FORMAT) - datetime_style = xlwt.easyxf('align: wrap yes', num_format_str=tools.DEFAULT_SERVER_DATETIME_FORMAT) + 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) - elif isinstance(cell_value, datetime.date): - cell_style = date_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() From 269f92998b5ff225cd5f7555f745e709578f3052 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 1 Apr 2014 14:30:52 +0200 Subject: [PATCH 14/22] [IMP] remove useless import bzr revid: mat@openerp.com-20140401123052-01ylsjx5q3vkoxbq --- addons/web/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 8e52cb64717..2771c658270 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -32,7 +32,7 @@ except ImportError: import openerp import openerp.modules.registry from openerp.tools.translate import _ -from openerp import http, tools +from openerp import http from openerp.http import request, serialize_exception as _serialize_exception From 2695cacea45051600682f22a02f812c5b77827df Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 1 Apr 2014 14:36:57 +0200 Subject: [PATCH 15/22] [FIX] account_analytic_analysis, analytic, hr_timesheet: do not override existing data of analytic account on template on_change bzr revid: dle@openerp.com-20140401123657-ozh4ycx36jojpg51 --- .../account_analytic_analysis.py | 51 +++++++++++-------- .../account_analytic_analysis_view.xml | 3 ++ addons/analytic/analytic.py | 5 +- addons/analytic/analytic_view.xml | 2 +- .../analytic_contract_hr_expense.py | 4 +- addons/hr_timesheet/hr_timesheet.py | 4 +- 6 files changed, 40 insertions(+), 29 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index ec5e2c56e6c..99890a5f239 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -543,33 +543,40 @@ class account_analytic_account(osv.osv): 'nodestroy': True, } - def on_change_template(self, cr, uid, ids, template_id, context=None): + def on_change_template(self, cr, uid, ids, template_id, date_start=False, fix_price_invoices=False, invoice_on_timesheets=False, recurring_invoices=False, context=None): if not template_id: return {} obj_analytic_line = self.pool.get('account.analytic.invoice.line') - res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context) template = self.browse(cr, uid, template_id, context=context) - invoice_line_ids = [] - for x in template.recurring_invoice_line_ids: - invoice_line_ids.append((0, 0, { - 'product_id': x.product_id.id, - 'uom_id': x.uom_id.id, - 'name': x.name, - 'quantity': x.quantity, - 'price_unit': x.price_unit, - 'analytic_account_id': x.analytic_account_id and x.analytic_account_id.id or False, - })) - res['value']['fix_price_invoices'] = template.fix_price_invoices - res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets - res['value']['hours_qtt_est'] = template.hours_qtt_est - res['value']['amount_max'] = template.amount_max - res['value']['to_invoice'] = template.to_invoice.id - res['value']['pricelist_id'] = template.pricelist_id.id - res['value']['recurring_invoices'] = template.recurring_invoices - res['value']['recurring_interval'] = template.recurring_interval - res['value']['recurring_rule_type'] = template.recurring_rule_type - res['value']['recurring_invoice_line_ids'] = invoice_line_ids + + if not fix_price_invoices: + res['value']['fix_price_invoices'] = template.fix_price_invoices + res['value']['amount_max'] = template.amount_max + if not invoice_on_timesheets: + res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets + res['value']['hours_qtt_est'] = template.hours_qtt_est + + if template.to_invoice.id: + res['value']['to_invoice'] = template.to_invoice.id + if template.pricelist_id.id: + res['value']['pricelist_id'] = template.pricelist_id.id + if not recurring_invoices: + invoice_line_ids = [] + for x in template.recurring_invoice_line_ids: + invoice_line_ids.append((0, 0, { + 'product_id': x.product_id.id, + 'uom_id': x.uom_id.id, + 'name': x.name, + 'quantity': x.quantity, + 'price_unit': x.price_unit, + 'analytic_account_id': x.analytic_account_id and x.analytic_account_id.id or False, + })) + res['value']['recurring_invoices'] = template.recurring_invoices + res['value']['recurring_interval'] = template.recurring_interval + res['value']['recurring_rule_type'] = template.recurring_rule_type + res['value']['recurring_invoice_line_ids'] = invoice_line_ids return res def onchange_recurring_invoices(self, cr, uid, ids, recurring_invoices, date_start=False, context=None): diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index f5b89db7089..d99be3db355 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -38,6 +38,9 @@ {'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]} + + on_change_template(template_id, date_start, fix_price_invoices, invoice_on_timesheets, recurring_invoices) + diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 894a2a2d6c5..c1ea1f655d2 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -203,7 +203,7 @@ class account_analytic_account(osv.osv): }, string='Currency', type='many2one', relation='res.currency'), } - def on_change_template(self, cr, uid, ids, template_id, context=None): + def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None): if not template_id: return {} res = {'value':{}} @@ -213,7 +213,8 @@ class account_analytic_account(osv.osv): to_dt = datetime.strptime(template.date, tools.DEFAULT_SERVER_DATE_FORMAT) timedelta = to_dt - from_dt res['value']['date'] = datetime.strftime(datetime.now() + timedelta, tools.DEFAULT_SERVER_DATE_FORMAT) - res['value']['date_start'] = fields.date.today() + if not date_start: + res['value']['date_start'] = fields.date.today() res['value']['quantity_max'] = template.quantity_max res['value']['parent_id'] = template.parent_id and template.parent_id.id or False res['value']['description'] = template.description diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml index 9a99552be13..5e65874a1d9 100644 --- a/addons/analytic/analytic_view.xml +++ b/addons/analytic/analytic_view.xml @@ -27,7 +27,7 @@ - + diff --git a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py index a1bf43714ce..3682755b9c4 100644 --- a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py +++ b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py @@ -115,8 +115,8 @@ class account_analytic_account(osv.osv): digits_compute=dp.get_precision('Account')), } - def on_change_template(self, cr, uid, id, template_id, context=None): - res = super(account_analytic_account, self).on_change_template(cr, uid, id, template_id, context=context) + def on_change_template(self, cr, uid, id, template_id, date_start=False, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, id, template_id, date_start=date_start, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['charge_expenses'] = template.charge_expenses diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 5baf8ec262b..7aa7cbaba08 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -207,8 +207,8 @@ class account_analytic_account(osv.osv): 'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"), } - def on_change_template(self, cr, uid, ids, template_id, context=None): - res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['use_timesheets'] = template.use_timesheets From 07ae370d90043806724d2ce4139c8f1ccdb5ab2d Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 1 Apr 2014 16:42:05 +0200 Subject: [PATCH 16/22] [FIX] project, project_issue: overwritten method on_change template, wrong signature, following commit 9277 revid:dle@openerp.com-20140401123657-ozh4ycx36jojpg51 bzr revid: dle@openerp.com-20140401144205-cmm5vfzlpsro0f7j --- addons/project/project.py | 4 ++-- addons/project_issue/project_issue.py | 4 ++-- addons/project_long_term/project_long_term.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index f6bd55c2fb6..96b1c84b94c 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1202,8 +1202,8 @@ class account_analytic_account(osv.osv): 'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'), } - def on_change_template(self, cr, uid, ids, template_id, context=None): - res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['use_tasks'] = template.use_tasks diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 6f072f5abd1..84abc33a7e6 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -530,8 +530,8 @@ class account_analytic_account(osv.Model): 'use_issues': fields.boolean('Issues', help="Check this field if this project manages issues"), } - def on_change_template(self, cr, uid, ids, template_id, context=None): - res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['use_issues'] = template.use_issues diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index a950907fb69..29e94591094 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -273,8 +273,8 @@ class account_analytic_account(osv.osv): 'use_phases': fields.boolean('Phases', help="Check this field if you plan to use phase-based scheduling"), } - def on_change_template(self, cr, uid, ids, template_id, context=None): - res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['use_phases'] = template.use_phases From 0b539587b89c9e67bcec51a1ab8683afd75f7ba2 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 1 Apr 2014 18:43:22 +0200 Subject: [PATCH 17/22] [IMP] kanban view for ir.attachments bzr revid: fp@tinyerp.com-20140401164322-fq3r0pt6idkoobxx --- addons/document/__openerp__.py | 2 +- addons/document/document_view.xml | 2 +- addons/mail/mail_message_view.xml | 30 ++++++++++++++++++++++++++++- addons/mail/static/src/css/mail.css | 18 ++++++++--------- addons/project/project.py | 2 +- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/addons/document/__openerp__.py b/addons/document/__openerp__.py index 501e5566e60..5cc674fcf45 100644 --- a/addons/document/__openerp__.py +++ b/addons/document/__openerp__.py @@ -37,7 +37,7 @@ This is a complete document management system. """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'depends': ['knowledge'], + 'depends': ['knowledge', 'mail'], 'data': [ 'security/document_security.xml', 'document_view.xml', diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index c0edf0dc9b8..b735d2ce4a4 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -235,7 +235,6 @@ - @@ -244,6 +243,7 @@ ir.actions.act_window ir.attachment form + kanban,form

Click to create a new document. diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index e2d1deb028b..2ed5f338825 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -89,5 +89,33 @@ + + ir.attachment kanban + ir.attachment + + + + + + + +

+
+ +
bb
+
+
+ +
aa
+
+
+ + + +
+ + + + - \ No newline at end of file + diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 614077b65a2..5a51bce04d9 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -318,7 +318,7 @@ .openerp .oe_mail .oe_msg_composer .oe_recipients input{ vertical-align: middle; } -.openerp .oe_mail .oe_attachment{ +.oe_attachment{ display: inline-block; width: 100px; margin: 4px 2px; @@ -328,7 +328,7 @@ text-align: center; vertical-align: top; } -.openerp .oe_mail .oe_attachment .oe_name{ +.oe_attachment .oe_name{ display: inline-block; max-width: 100%; padding: 1px 3px; @@ -341,10 +341,10 @@ border-radius: 3px; } -.openerp .oe_mail .oe_attachment.oe_preview{ +.oe_attachment.oe_preview{ background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJ0lEQVQYV2MsLS39z4AGLCws0IUYGIeCwrVr12J45sSJE5ieGQIKAbuZKf/EMCs7AAAAAElFTkSuQmCC ); } -.openerp .oe_mail .oe_attachment .oe_progress_bar{ +.oe_attachment .oe_progress_bar{ display: none; position: absolute; top: 18px; @@ -364,7 +364,7 @@ -o-animation: oe_mail_attach_loading_anim 0.75s infinite linear; animation: oe_mail_attach_loading_anim 0.75s infinite linear; } -.openerp .oe_mail .oe_attachment.oe_uploading .oe_progress_bar{ +.oe_attachment.oe_uploading .oe_progress_bar{ display: block; } @-webkit-keyframes oe_mail_attach_loading_anim{ @@ -387,7 +387,7 @@ 50% { background: #009123 } 100% { background: #4BBD00 } } -.openerp .oe_mail .oe_attachment.oe_preview .oe_name{ +.oe_attachment.oe_preview .oe_name{ position: absolute; bottom: 0px; margin: 3px; @@ -405,14 +405,14 @@ -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; } -.openerp .oe_mail .oe_attachment.oe_preview:hover .oe_name{ +.oe_attachment.oe_preview:hover .oe_name{ opacity: 1; -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; } -.openerp .oe_mail .oe_attachment img{ +.oe_attachment img{ position: absolute; width: 48px; height: 48px; @@ -420,7 +420,7 @@ left: 50%; margin-left: -24px; } -.openerp .oe_mail .oe_attachment.oe_preview img{ +.oe_attachment.oe_preview img{ display: block; position: relative; margin:0px; diff --git a/addons/project/project.py b/addons/project/project.py index 96b1c84b94c..9dcf069a856 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -223,7 +223,7 @@ class project(osv.osv): 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'view_id': False, - 'view_mode': 'tree,form', + 'view_mode': 'kanban,form', 'view_type': 'form', 'limit': 80, 'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id) From 6a9379429cea71120c9422596c5dfa0a794e2acb Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 1 Apr 2014 18:47:00 +0200 Subject: [PATCH 18/22] [IMP] kanban of documents for recruitement attachments bzr revid: fp@tinyerp.com-20140401164700-xj1d5hn9zv8morfu --- addons/mail/mail_message_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index 2ed5f338825..1c4a7f55c10 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -114,6 +114,9 @@
+ + kanban,form + From 4afeee59d10485b84740faf4182678a733f24b03 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 2 Apr 2014 10:37:17 +0200 Subject: [PATCH 19/22] [FIX] fixes an alignment issue in the template definitions (addon web) bzr revid: ged@openerp.com-20140402083717-y3p22u2e47d60bbt --- addons/web/static/src/xml/base.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1a5721d28f8..23cad2098dc 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1373,7 +1373,8 @@
- + +
From 9588999c7c45cbaabb0dce9b31857eb779928905 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 3 Apr 2014 09:25:48 +0200 Subject: [PATCH 20/22] [IMP] Tracks: alphabetic order bzr revid: fp@tinyerp.com-20140403072548-y4823lyjuovl5neu --- addons/website_event_track/models/event.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/website_event_track/models/event.py b/addons/website_event_track/models/event.py index bb7c8db17d9..716aac6bff4 100644 --- a/addons/website_event_track/models/event.py +++ b/addons/website_event_track/models/event.py @@ -25,12 +25,14 @@ from openerp.addons.website.models.website import slug class event_track_tag(osv.osv): _name = "event.track.tag" + _order = 'name' _columns = { 'name': fields.char('Event Track Tag') } class event_tag(osv.osv): _name = "event.tag" + _order = 'name' _columns = { 'name': fields.char('Event Tag') } From 438025dac803afc3adeb8ef7f561b2b78e027bb1 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 3 Apr 2014 14:31:44 +0200 Subject: [PATCH 21/22] [FIX] setup.py: correct included packages in py2exe options bzr revid: nightly_server-20140403123144-pm4dqs04dbfmv1p8 --- setup.py | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 545b02e9bbd..214002d6f44 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ def data(): # but this will work fine (especially since we don't use the ZIP file # approach). r["babel/localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*')) - others = ['global.dat', 'numbers.py', 'support.py'] + others = ['global.dat', 'numbers.py', 'support.py', 'plural.py'] r["babel"] = map(lambda f: os.path.join(os.path.dirname(babel.__file__), f), others) others = ['frontend.py', 'mofile.py'] r["babel/messages"] = map(lambda f: os.path.join(os.path.dirname(babel.__file__), "messages", f), others) @@ -75,7 +75,42 @@ def py2exe_options(): "skip_archive": 1, "optimize": 0, # keep the assert running, because the integrated tests rely on them. "dist_dir": 'dist', - "packages": ["HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "docutils", "email", "encodings", "imaplib", "jinja2", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "pytz", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ], + "packages": [ + "HTMLParser", + "PIL", + "asynchat", "asyncore", + "commands", + "dateutil", + "decimal", + "docutils", + "email", + "encodings", + "imaplib", + "jinja2", + "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", + "mako", + "markupsafe", # dependence of jinja2 and mako + "mock", + "openerp", + "poplib", + "psutil", + "pychart", + "pydot", + "pyparsing", + "pytz", + "reportlab", + "requests", + "select", + "simplejson", + "smtplib", + "uuid", + "vatnumber", + "vobject", + "win32service", "win32serviceutil", + "xlwt", + "xml", "xml.dom", + "yaml", + ], "excludes" : ["Tkconstants","Tkinter","tcl"], } } @@ -151,7 +186,7 @@ setuptools.setup( extras_require = { 'SSL' : ['pyopenssl'], }, - tests_require = ['unittest2'], + tests_require = ['unittest2', 'mock'], **py2exe_options() ) From 7c29e3847cd596d8befcc8d1169678beb8c41177 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 3 Apr 2014 15:41:09 +0200 Subject: [PATCH 22/22] [FIX] increase js test timeout to 60 when runbot is overloaded, test speed can be slow, 2s per HTTP request bzr revid: al@openerp.com-20140403134109-nzg71xmybw1p5bsi --- openerp/tests/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/tests/common.py b/openerp/tests/common.py index a53a8d82240..c1f7cf88ed1 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -255,7 +255,7 @@ class HttpCase(TransactionCase): phantom.terminate() _logger.info("phantom_run execution finished") - def phantom_jsfile(self, jsfile, timeout=30, **kw): + def phantom_jsfile(self, jsfile, timeout=60, **kw): options = { 'timeout' : timeout, 'port': PORT, @@ -269,7 +269,7 @@ class HttpCase(TransactionCase): cmd = ['phantomjs', jsfile, phantomtest, json.dumps(options)] self.phantom_run(cmd, timeout) - def phantom_js(self, url_path, code, ready="window", login=None, timeout=30, **kw): + def phantom_js(self, url_path, code, ready="window", login=None, timeout=60, **kw): """ Test js code running in the browser - optionnally log as 'login' - load page given by url_path