From f6070e7cf14f158c26de2e18baae1aaaf27017dd Mon Sep 17 00:00:00 2001 From: David Coninckx Date: Mon, 30 Mar 2015 16:06:24 +0200 Subject: [PATCH] Remove hardcoded state to use option "field_color" and some logs --- web_m2x_options/static/src/js/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 52a06f35..5171c1bf 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -115,10 +115,10 @@ openerp.web_m2x_options = function (instance) { Objects.query([self.field_color]) .filter([['id', 'in', value_ids]]) .all().done(function (objects) { - console.log(objects); for (var index in objects) { var value = values[index]; - var color = self.colors[objects[index].state] || 'black'; + // Find color with field value as key + var color = self.colors[objects[index][self.field_color]] || 'black'; value.label = ''+value.label+''; } def.resolve(values);