From 2542992c24b7e1c5ca86360b07c66539df41aa81 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Thu, 19 Jun 2014 14:10:24 +0200 Subject: [PATCH 1/2] Fix sale_id on stock.picking.out view View inheritance is on the wrong model after model change of stock.picking. Here we just fix the model. --- addons/sale_stock/stock_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/stock_view.xml b/addons/sale_stock/stock_view.xml index d4bf4fc4629..f4ed19b5127 100644 --- a/addons/sale_stock/stock_view.xml +++ b/addons/sale_stock/stock_view.xml @@ -51,7 +51,7 @@ Outgoing picking Inherited - stock.picking + stock.picking.out From e2201369a314feaec70a485f0459c1dcdcecd82b Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 24 Jun 2014 13:53:02 +0200 Subject: [PATCH 2/2] [FIX] web: format.js, toString while parsing date When attempting to parse client date, value is not always a string. We force the toString when adding the leading 0, as the replace method is for string --- addons/web/static/src/js/formats.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index cf53d9fb3f0..aa40975e0ab 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -266,7 +266,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) { value, (date_pattern + ' ' + time_pattern)); if (datetime !== null) return instance.web.datetime_to_str(datetime); - datetime = Date.parseExact(value.replace(/\d+/g, function(m){ + datetime = Date.parseExact(value.toString().replace(/\d+/g, function(m){ return m.length === 1 ? "0" + m : m ; }), (date_pattern + ' ' + time_pattern)); if (datetime !== null) @@ -279,7 +279,7 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) { var date = Date.parseExact(value, date_pattern); if (date !== null) return instance.web.date_to_str(date); - date = Date.parseExact(value.replace(/\d+/g, function(m){ + date = Date.parseExact(value.toString().replace(/\d+/g, function(m){ return m.length === 1 ? "0" + m : m ; }), date_pattern); if (date !== null)