From 348d05be82f59d8aac0c1dd1f9d713d7e39569e2 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Thu, 3 Oct 2013 11:00:02 +0530 Subject: [PATCH 1/3] [IMP]improved position of m2o autocomplete. bzr revid: kch@tinyerp.com-20131003053002-v4bzzklwzbinxw2a --- addons/web/static/src/js/view_form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a00b66cbeda..79fdb3e4f4e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3390,6 +3390,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc minLength: 0, delay: 0 }); + //set position for list of suggetions box + this.$input.autocomplete( "option", "position", { my : "left top", at: "left bottom" } ); this.$input.autocomplete("widget").openerpClass(); // used to correct a bug when selecting an element by pushing 'enter' in an editable list this.$input.keyup(function(e) { From 10046d854c9973c23208073b21ab95725981ec7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Mon, 28 Apr 2014 17:33:26 +0200 Subject: [PATCH 2/3] [IMP] point_of_sale: use the product unit's precision for rounding the weight bzr revid: fva@openerp.com-20140428153326-klgddc93ud9t0uqr --- addons/point_of_sale/static/src/js/screens.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index c58e7d860a0..71fdb3a5609 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -19,6 +19,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var QWeb = instance.web.qweb, _t = instance.web._t; + var round_pr = instance.web.round_precision + module.ScreenSelector = instance.web.Class.extend({ init: function(options){ this.pos = options.pos; @@ -564,7 +566,20 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.$('.js-weight').text(this.get_product_weight_string()); }, get_product_weight_string: function(){ - return (this.weight || 0).toFixed(3) + ' Kg'; + var product = this.get_product(); + var defaultstr = (this.weight || 0).toFixed(3) + ' Kg'; + if(!product || !this.pos){ + return defaultstr; + } + var unit_id = product.uos_id || product.uom_id; + if(!unit_id){ + return defaultstr; + } + var unit = this.pos.units_by_id[unit_id[0]]; + var weight = round_pr(this.weight || 0, unit.rounding); + var weightstr = weight.toFixed(Math.ceil(Math.log(1.0/unit.rounding) / Math.log(10) )); + weightstr += ' Kg'; + return weightstr; }, get_product_image_url: function(){ var product = this.get_product(); From 0059d7b1cd15f6aeed3cd60e95e57a66ae570ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 29 Apr 2014 12:19:32 +0200 Subject: [PATCH 3/3] [FIX] product: the declaration of decimal precision was done after the declaration of uom precision, preventing uom precision from going above the default decimal precision. + made the Kg unit precise up to grams by default. bzr revid: fva@openerp.com-20140429101932-k6s827csz6i1za51 --- addons/product/product_data.xml | 54 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index c1c0a577092..85462bb851d 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -28,6 +28,35 @@ Volume + + + + Product Price + 2 + + + Discount + 2 + + + Account + 2 + + + Stock Weight + 2 + + + Product Unit of Measure + + + + Product UoS + + + @@ -47,6 +76,7 @@ kg + @@ -211,30 +241,6 @@ parameter) will see those record just disappear. - - Product Price - 2 - - - Discount - 2 - - - Account - 2 - - - Stock Weight - 2 - - - Product Unit of Measure - - - - Product UoS - -