From 65cd88d2167fe855ba941bedafe903c791883bc8 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Sat, 17 May 2014 09:08:25 +0200 Subject: [PATCH 01/45] [IMP] Added quantity as type and variable_factor + sequence for flexibility to delivery grid line --- addons/delivery/delivery.py | 14 +++++++++----- addons/delivery/delivery_view.xml | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index b5c8bae429e..1d3bc14d5e6 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -191,21 +191,23 @@ class delivery_grid(osv.osv): total = 0 weight = 0 volume = 0 + quantity = 0 for line in order.order_line: if not line.product_id or line.is_delivery: continue weight += (line.product_id.weight or 0.0) * line.product_uom_qty volume += (line.product_id.volume or 0.0) * line.product_uom_qty + quantity += line.product_uom_qty total = order.amount_total or 0.0 - return self.get_price_from_picking(cr, uid, id, total,weight, volume, context=context) + return self.get_price_from_picking(cr, uid, id, total,weight, volume, quantity, context=context) - def get_price_from_picking(self, cr, uid, id, total, weight, volume, context=None): + def get_price_from_picking(self, cr, uid, id, total, weight, volume, quantity, context=None): grid = self.browse(cr, uid, id, context=context) price = 0.0 ok = False - price_dict = {'price': total, 'volume':volume, 'weight': weight, 'wv':volume*weight} + price_dict = {'price': total, 'volume':volume, 'weight': weight, 'wv':volume*weight, 'quantity': quantity} for line in grid.line_ids: test = eval(line.type+line.operator+str(line.max_value), price_dict) if test: @@ -227,9 +229,10 @@ class delivery_grid_line(osv.osv): _description = "Delivery Grid Line" _columns = { 'name': fields.char('Name', size=64, required=True), + 'sequence': fields.integer('Sequence', size=64, required=True, help="Gives the sequence order when calculating delivery grid."), 'grid_id': fields.many2one('delivery.grid', 'Grid',required=True, ondelete='cascade'), 'type': fields.selection([('weight','Weight'),('volume','Volume'),\ - ('wv','Weight * Volume'), ('price','Price')],\ + ('wv','Weight * Volume'), ('price','Price'), ('quantity','Quantity')],\ 'Variable', required=True), 'operator': fields.selection([('==','='),('<=','<='),('>=','>=')], 'Operator', required=True), 'max_value': fields.float('Maximum Value', required=True), @@ -239,12 +242,13 @@ class delivery_grid_line(osv.osv): 'standard_price': fields.float('Cost Price', digits_compute= dp.get_precision('Product Price'), required=True), } _defaults = { + 'sequence': lambda *args: 10, 'type': lambda *args: 'weight', 'operator': lambda *args: '<=', 'price_type': lambda *args: 'fixed', 'variable_factor': lambda *args: 'weight', } - _order = 'list_price' + _order = 'sequence, list_price' # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 31c0e08b093..ffb7146e04a 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -179,6 +179,7 @@
+ From e7e4f8cefaf440ea8a59793b221b376a50cac690 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Sat, 17 May 2014 11:44:09 +0200 Subject: [PATCH 02/45] [IMP] remove setting of color.ui After further considering PR #21's arguments, the setup script should not go around setting `color.ui`: * it shouldn't be needed for recent gits with default compile settings[0] * it may override advanced users's own colour configuration/ customisations (or disabling) * it forces default colours on users for which it may be useless (colour- blind) or even detrimental (other vision impairments) * some linux distributions apparently default to idiotic pagers which can't handle ANSI colour codes by default and spew garbage to the terminal [0] https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.4.txt#L178-L180 --- checkout.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/checkout.sh b/checkout.sh index 5a51dd0e4da..0955508a178 100755 --- a/checkout.sh +++ b/checkout.sh @@ -57,7 +57,6 @@ cd $copyname git config user.name "$name" git config user.email "$email" -git config color.ui auto # pre-push script preventing push to odoo repo by default. Git just execs # them, so they need a correct shebang and exec bit From fd223b1d5d3efcb076db6bee308233f587814584 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Sat, 17 May 2014 15:53:49 +0200 Subject: [PATCH 03/45] Add quantity in variable factor too... I forgot to add the changes before committing --- addons/delivery/delivery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 1d3bc14d5e6..362703bccb7 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -237,7 +237,7 @@ class delivery_grid_line(osv.osv): 'operator': fields.selection([('==','='),('<=','<='),('>=','>=')], 'Operator', required=True), 'max_value': fields.float('Maximum Value', required=True), 'price_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Price Type', required=True), - 'variable_factor': fields.selection([('weight','Weight'),('volume','Volume'),('wv','Weight * Volume'), ('price','Price')], 'Variable Factor', required=True), + 'variable_factor': fields.selection([('weight','Weight'),('volume','Volume'),('wv','Weight * Volume'), ('price','Price'), ('quantity','Quantity')], 'Variable Factor', required=True), 'list_price': fields.float('Sale Price', digits_compute= dp.get_precision('Product Price'), required=True), 'standard_price': fields.float('Cost Price', digits_compute= dp.get_precision('Product Price'), required=True), } From 49657b28e6915c46342a509e7b4c1e62645e16d4 Mon Sep 17 00:00:00 2001 From: etenesaca Date: Tue, 20 May 2014 14:58:40 -0500 Subject: [PATCH 04/45] Now when a search is conducted in the fields and not m2o results have a message saying "No results to show" since the show nothing will display the user is confused --- addons/web/static/src/js/view_form.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4c4ba6f004c..582ddd7597e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3394,6 +3394,11 @@ instance.web.form.CompletionFieldMixin = { classname: 'oe_m2o_dropdown_option' }); } + else if (values.length == 0) + values.push({ + label: "
" + _t("No results to show...") + "
", + action: function() {}, + }); return values; }); From bd8b2e9002194c08f4828c9a29ef8af3bc2f64e1 Mon Sep 17 00:00:00 2001 From: etenesaca Date: Tue, 20 May 2014 21:16:52 -0500 Subject: [PATCH 05/45] Optimized search fields from m2o Added translation of the message Now this style of message in a CSS class and not use HTML tags --- addons/web/i18n/es.po | 7 +++++++ addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/js/view_form.js | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addons/web/i18n/es.po b/addons/web/i18n/es.po index b43baf25b21..9be938168dc 100644 --- a/addons/web/i18n/es.po +++ b/addons/web/i18n/es.po @@ -1292,6 +1292,13 @@ msgstr "Agrupar por: %s" msgid "No data provided." msgstr "No se han facilitado datos" +#. module: web +#. openerp-web +#: code:addons/web/static/src/js/view_form.js:3399 +#, python-format +msgid "No results to show..." +msgstr "No hay resultados para mostrar..." + #. module: web #. openerp-web #: code:addons/web/static/src/js/view_list.js:345 diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f02dc3c7fd7..b6d12b38688 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2409,6 +2409,10 @@ .openerp .oe_form_field_many2one input { padding-right: 13px; } +.openerp.ui-autocomplete li.oe_m2o_dropdown_option_no_results_to_show a { + font-style: italic; + text-align: center; +} .openerp.ui-autocomplete li.oe_m2o_dropdown_option a { font-style: italic; padding-left: 2em; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 582ddd7597e..14cd0551fd4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3396,8 +3396,9 @@ instance.web.form.CompletionFieldMixin = { } else if (values.length == 0) values.push({ - label: "
" + _t("No results to show...") + "
", + label: _t("No results to show..."), action: function() {}, + classname: 'oe_m2o_dropdown_option_no_results_to_show' }); return values; From 3772a3a3af9e35d49d4562b9c01b4e77fc379eb2 Mon Sep 17 00:00:00 2001 From: Yogesh Parekh Date: Thu, 22 May 2014 15:23:09 +0530 Subject: [PATCH 06/45] Remove html fields in frontend from website_quote module --- addons/website_quote/views/website_quotation_backend.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/website_quote/views/website_quotation_backend.xml b/addons/website_quote/views/website_quotation_backend.xml index 283f82a38c5..2f21f7d8e0a 100644 --- a/addons/website_quote/views/website_quotation_backend.xml +++ b/addons/website_quote/views/website_quotation_backend.xml @@ -21,7 +21,6 @@ - @@ -29,7 +28,6 @@ - @@ -79,9 +77,6 @@ - - - @@ -91,7 +86,6 @@ - @@ -104,12 +98,10 @@ - - From a79ffefd87a786db49daadd37a2cbdb22abaeccd Mon Sep 17 00:00:00 2001 From: Yogesh Parekh Date: Thu, 22 May 2014 15:26:10 +0530 Subject: [PATCH 07/45] Remove description html field in website_forum module --- addons/website_forum/views/forum.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/website_forum/views/forum.xml b/addons/website_forum/views/forum.xml index 233aeae40be..d728d51fc13 100644 --- a/addons/website_forum/views/forum.xml +++ b/addons/website_forum/views/forum.xml @@ -24,7 +24,6 @@ - From c0f453a1eabc61f5da360cb82a8227ba449734b7 Mon Sep 17 00:00:00 2001 From: Yogesh Parekh Date: Thu, 22 May 2014 15:28:39 +0530 Subject: [PATCH 08/45] Remove description html field from website_event_track module --- addons/website_event_track/views/event_backend.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/website_event_track/views/event_backend.xml b/addons/website_event_track/views/event_backend.xml index 3e77909d308..cfab3b6229c 100644 --- a/addons/website_event_track/views/event_backend.xml +++ b/addons/website_event_track/views/event_backend.xml @@ -330,8 +330,6 @@
-