From f5dd09dd841f3c78dcdb1ddb583b2166af5b46bc Mon Sep 17 00:00:00 2001 From: Miku Laitinen Date: Wed, 24 Jun 2015 13:02:18 +0300 Subject: [PATCH 01/13] [ADD] base: Finnish address format --- openerp/addons/base/res/res_country_data.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/addons/base/res/res_country_data.xml b/openerp/addons/base/res/res_country_data.xml index affa93f5329fc..c9ef761d28222 100644 --- a/openerp/addons/base/res/res_country_data.xml +++ b/openerp/addons/base/res/res_country_data.xml @@ -428,6 +428,7 @@ Finland fi + From 443c38dbc0a9b70f9d0d1177ae50d52ade72d84e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Jun 2015 11:37:21 +0200 Subject: [PATCH 02/13] [IMP] product: fnct_inv of image variant Doesn't seem to have much effect, but it's probably still better to not have 3 UPDATE run every time we create a new product.product. --- addons/product/product.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 30ee7a9a9b7a7..44f6dcf81a306 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -946,12 +946,12 @@ def _get_image_variant(self, cr, uid, ids, name, args, context=None): def _set_image_variant(self, cr, uid, id, name, value, args, context=None): image = tools.image_resize_image_big(value) - res = self.write(cr, uid, [id], {'image_variant': image}, context=context) + product = self.browse(cr, uid, id, context=context) - if not product.product_tmpl_id.image: - product.write({'image_variant': None}) - product.product_tmpl_id.write({'image': image}) - return res + if product.product_tmpl_id.image: + product.image_variant = image + else: + product.product_tmpl_id.image = image def _get_price_extra(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) From d1a19bcb7f0f41b80f6df3afefb2753a2222d887 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Jun 2015 17:06:17 +0200 Subject: [PATCH 03/13] [IMP] base: performances of view._check_xml View validation accounts for a fair cost of module installation, most of that is spent checking for view validity, and a significant fraction of *that* is spent reading the validated view from the DB. Turns out _check_xml requested *all* view fields even though it needed none of them save for the arch. Specifying fields to read_combined rather than fetching all fields seems to result in a ~30% speedup of _check_xml (under line_profiler). Most of the rest is spent fetching sub-views (in get_inheriting_view_arch), I don't know that it can be improved without hand-crafting a fairly complex SQL request. --- openerp/addons/base/ir/ir_ui_view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index ea7b11c426d05..341f1ad71192a 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -203,7 +203,7 @@ def _check_xml(self, cr, uid, ids, context=None): # Sanity checks: the view should not break anything upon rendering! # Any exception raised below will cause a transaction rollback. for view in self.browse(cr, uid, ids, context): - view_def = self.read_combined(cr, uid, view.id, None, context=context) + view_def = self.read_combined(cr, uid, view.id, ['arch'], context=context) view_arch_utf8 = view_def['arch'] if view.type != 'qweb': view_doc = etree.fromstring(view_arch_utf8) @@ -527,7 +527,7 @@ def read_combined(self, cr, uid, view_id, fields=None, context=None): # arch and model fields are always returned if fields: - fields = list(set(fields) | set(['arch', 'model'])) + fields = list({'arch', 'model'}.union(fields)) # read the view arch [view] = self.read(cr, uid, [root_id], fields=fields, context=context) From 33a65c2b8e5ae9f91be614e3b1ef2f0584c4e436 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Fri, 21 Mar 2014 09:05:04 +0000 Subject: [PATCH 04/13] [FIX] web: binary fields in one2many widgets Don't retrieve the binary contents just to display the size, but pass context with bin_size=True instead Always pass filename in download link Combination of patches from the bug report from Enrico Ganzaroli, Cedric Le Brouster and Holger Brunn Fixes #4899, lp:1167429 --- addons/web/static/src/js/data.js | 2 +- addons/web/static/src/js/view_form.js | 6 +++++- addons/web/static/src/js/view_list.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 8936c40b051a3..2170cee46fd24 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -753,7 +753,7 @@ instance.web.DataSetStatic = instance.web.DataSet.extend({ var offset = options.offset || 0, limit = options.limit || false; var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length; - return this.read_ids(this.ids.slice(offset, end_pos), fields); + return this.read_ids(this.ids.slice(offset, end_pos), fields, options); }, set_ids: function (ids) { this.ids = ids; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bed45dc28b575..52ad15f843eae 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4391,8 +4391,12 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({ }); instance.web.form.One2ManyDataSet = instance.web.BufferedDataSet.extend({ - get_context: function() { + get_context: function(extra_context) { this.context = this.o2m.build_context(); + if(extra_context) + { + this.context.add(extra_context); + } return this.context; } }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index ee934d6a2c94c..b08f5ca3bc9d7 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -2305,7 +2305,7 @@ instance.web.list.Binary = instance.web.list.Column.extend({ * @private */ _format: function (row_data, options) { - var text = _t("Download"); + var text = _t("Download"), filename=_t('Binary file'); var value = row_data[this.id].value; if (!value) { return options.value_if_empty || ''; @@ -2323,11 +2323,13 @@ instance.web.list.Binary = instance.web.list.Column.extend({ if (this.filename && row_data[this.filename]) { text = _.str.sprintf(_t("Download \"%s\""), instance.web.format_value( row_data[this.filename].value, {type: 'char'})); + filename = row_data[this.filename].value; } - return _.template('<%-text%> (<%-size%>)', { + return _.template('<%-text%> (<%-size%>)', { text: text, href: download_url, size: instance.web.binary_to_binsize(value), + download: filename, }); } }); From a3fbc2da86d9184ffad669d8fd16806d289bfdf7 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 25 Jun 2015 10:19:52 +0200 Subject: [PATCH 05/13] [FIX] point of sale: rounding globally The amount total computed for pos order must be the sum of the rounded tax amount and the rounded untax amount. Inspired from _amount_total in "sale.order". opw:643254 --- addons/point_of_sale/point_of_sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 3fbd3257b0fa5..8f84809164f62 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -689,7 +689,8 @@ def _amount_all(self, cr, uid, ids, name, args, context=None): val1 += self._amount_line_tax(cr, uid, line, context=context) val2 += line.price_subtotal res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val1) - res[order.id]['amount_total'] = cur_obj.round(cr, uid, cur, val1+val2) + amount_untaxed = cur_obj.round(cr, uid, cur, val2) + res[order.id]['amount_total'] = res[order.id]['amount_tax'] + amount_untaxed return res _columns = { From 384b60b3c769c3f4d5a87da82e894b9c9067d3a6 Mon Sep 17 00:00:00 2001 From: Robin Lucbernet Date: Thu, 25 Jun 2015 11:59:07 +0200 Subject: [PATCH 06/13] [CLA] META-IT --- doc/cla/corporate/meta-it.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/cla/corporate/meta-it.md diff --git a/doc/cla/corporate/meta-it.md b/doc/cla/corporate/meta-it.md new file mode 100644 index 0000000000000..01b33f35c8b41 --- /dev/null +++ b/doc/cla/corporate/meta-it.md @@ -0,0 +1,15 @@ +France, 2015 June 25 + +META-IT agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Robin Lucbenet robin@meta-it.fr https://github.com/n1b0r + +List of contributors: + +Guillaume Masson guillaume.masson@meta-it.fr From 8ab6865849e50404d45a0bdeaa3e8953226d63e4 Mon Sep 17 00:00:00 2001 From: Robin Lucbernet Date: Thu, 25 Jun 2015 12:00:49 +0200 Subject: [PATCH 07/13] [FIX] delivery: delivery_set returns a result The delivery_set() method has no return statement. Calling this method through xmlrpc produce an error since None is not valid. Closes #1033 --- addons/delivery/sale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/delivery/sale.py b/addons/delivery/sale.py index a31b51ce000dc..83744d56e0a4c 100644 --- a/addons/delivery/sale.py +++ b/addons/delivery/sale.py @@ -66,6 +66,7 @@ def delivery_set(self, cr, uid, ids, context=None): acc_fp_obj = self.pool.get('account.fiscal.position') self._delivery_unset(cr, uid, ids, context=context) currency_obj = self.pool.get('res.currency') + line_ids = [] for order in self.browse(cr, uid, ids, context=context): grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id) if not grid_id: @@ -84,7 +85,7 @@ def delivery_set(self, cr, uid, ids, context=None): price_unit = currency_obj.compute(cr, uid, order.company_id.currency_id.id, order.pricelist_id.currency_id.id, price_unit, context=dict(context or {}, date=order.date_order)) #create the sale order line - line_obj.create(cr, uid, { + line_id = line_obj.create(cr, uid, { 'order_id': order.id, 'name': grid.carrier_id.name, 'product_uom_qty': 1, @@ -94,3 +95,5 @@ def delivery_set(self, cr, uid, ids, context=None): 'tax_id': [(6, 0, taxes_ids)], 'is_delivery': True }, context=context) + line_ids.append(line_id) + return line_ids From a6b5290b79065d8f0f1c94050f88628c4cbfe9b7 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 25 Jun 2015 12:21:31 +0200 Subject: [PATCH 08/13] [I18N] analytic_user_function: remove on_change terms This should have never been in .pot file. Do your job Transifex source file watcher thingy! --- .../analytic_user_function/i18n/analytic_user_function.pot | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/analytic_user_function/i18n/analytic_user_function.pot b/addons/analytic_user_function/i18n/analytic_user_function.pot index 6d9501ab66b78..e80f971a3b6d2 100644 --- a/addons/analytic_user_function/i18n/analytic_user_function.pot +++ b/addons/analytic_user_function/i18n/analytic_user_function.pot @@ -130,9 +130,3 @@ msgstr "" #: field:account.analytic.account,user_product_ids:0 msgid "Users/Products Rel." msgstr "" - -#. module: analytic_user_function -#: view:hr_timesheet_sheet.sheet:analytic_user_function.hr_timesheet_sheet_form_inherit -msgid "on_change_account_id(account_id, user_id, unit_amount)" -msgstr "" - From cd9a5a5eb98eb64c113a7ee88d4dd2115aa89a08 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 25 Jun 2015 12:01:00 +0200 Subject: [PATCH 09/13] [FIX] payment_ogone: convert date received by Ogone Ogone sends back the date with format MM/DD/YY See https://secure.ogone.com/ncol/param_cookbook.asp opw-642757 --- addons/payment_ogone/models/ogone.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/payment_ogone/models/ogone.py b/addons/payment_ogone/models/ogone.py index 3903a752c4351..e3e33c69db93d 100644 --- a/addons/payment_ogone/models/ogone.py +++ b/addons/payment_ogone/models/ogone.py @@ -5,6 +5,7 @@ from lxml import etree, objectify from pprint import pformat import time +from datetime import datetime from urllib import urlencode import urllib2 import urlparse @@ -13,7 +14,7 @@ from openerp.addons.payment_ogone.controllers.main import OgoneController from openerp.addons.payment_ogone.data import ogone from openerp.osv import osv, fields -from openerp.tools import float_round +from openerp.tools import float_round, DEFAULT_SERVER_DATE_FORMAT from openerp.tools.float_utils import float_compare _logger = logging.getLogger(__name__) @@ -244,7 +245,7 @@ def _ogone_form_validate(self, cr, uid, tx, data, context=None): if status in self._ogone_valid_tx_status: tx.write({ 'state': 'done', - 'date_validate': data['TRXDATE'], + 'date_validate': datetime.strptime(data['TRXDATE'],'%m/%d/%y').strftime(DEFAULT_SERVER_DATE_FORMAT), 'acquirer_reference': data['PAYID'], }) return True From 7f80e57818455582798d992c603afb9e50783bc2 Mon Sep 17 00:00:00 2001 From: Nicolas Piganeau Date: Thu, 25 Jun 2015 16:26:30 +0200 Subject: [PATCH 10/13] [CLA] Changed email address Nicolas Piganeau --- doc/cla/individual/npiganeau.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cla/individual/npiganeau.md b/doc/cla/individual/npiganeau.md index 4cd08fcb99c42..a01f87403d2a1 100644 --- a/doc/cla/individual/npiganeau.md +++ b/doc/cla/individual/npiganeau.md @@ -8,4 +8,4 @@ declaration. Signed, -Nicolas Piganeau nicolas.piganeau@ndp-systemes.fr https://github.com/npiganeau \ No newline at end of file +Nicolas Piganeau npi@m4x.org https://github.com/npiganeau \ No newline at end of file From 117238fcc1ff5ecedf279551de866dc494010f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20Sausin=20=28Num=C3=A9rigraphe=29?= Date: Mon, 28 Jul 2014 11:51:55 +0200 Subject: [PATCH 11/13] [IMP] stock: Make the description of the UoS feature not misleading The description was misleading because sales and invoices are using the UoS quantity. It's actually the WMS that does not use it. Closes #1413 --- addons/stock/res_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/res_config.py b/addons/stock/res_config.py index b0c9088e05105..852550976da01 100644 --- a/addons/stock/res_config.py +++ b/addons/stock/res_config.py @@ -82,10 +82,10 @@ class stock_config_settings(osv.osv_memory): 'group_uom': fields.boolean("Manage different units of measure for products", implied_group='product.group_uom', help="""Allows you to select and maintain different units of measure for products."""), - 'group_uos': fields.boolean("Invoice products in a different unit of measure than the sales order", + 'group_uos': fields.boolean("Store products in a different unit of measure than the sales order", implied_group='product.group_uos', - help='Allows you to sell units of a product, but invoice based on a different unit of measure.\n' - 'For instance, you can sell pieces of meat that you invoice based on their weight.'), + help='Allows you to store units of a product, but sell and invoice based on a different unit of measure.\n' + 'For instance, you can store pieces of meat that you sell and invoice based on their weight.'), 'group_stock_packaging': fields.boolean("Allow to define several packaging methods on products", implied_group='product.group_stock_packaging', help="""Allows you to create and manage your packaging dimensions and types you want to be maintained in your system."""), From bf0630e4278088517bc4b81c796d8aa4ebf7fa7a Mon Sep 17 00:00:00 2001 From: Developer Team Date: Fri, 10 Apr 2015 06:50:37 -0500 Subject: [PATCH 12/13] [FIX] tools: add support for transparency of PNG images Fixes #2569 Closes #6260 --- openerp/tools/image.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openerp/tools/image.py b/openerp/tools/image.py index 6a7a46c7d84f3..e53ee879f58bb 100644 --- a/openerp/tools/image.py +++ b/openerp/tools/image.py @@ -129,9 +129,14 @@ def image_save_for_web(image, fp=None, format=None): opt = dict(format=image.format or format) if image.format == 'PNG': opt.update(optimize=True) + alpha = False + if image.mode in ('RGBA', 'LA') or (image.mode == 'P' and 'transparency' in image.info): + alpha = image.convert('RGBA').split()[-1] if image.mode != 'P': # Floyd Steinberg dithering by default image = image.convert('RGBA').convert('P', palette=Image.WEB, colors=256) + if alpha: + image.putalpha(alpha) elif image.format == 'JPEG': opt.update(optimize=True, quality=80) if fp: From aaf523135888a8b446834aa0356d3efc922344ec Mon Sep 17 00:00:00 2001 From: Nicolas Bustillos Date: Thu, 25 Jun 2015 13:34:29 -0400 Subject: [PATCH 13/13] [CLA] Correct email Nicolas Bustillos --- doc/cla/individual/nicobustillos.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cla/individual/nicobustillos.md b/doc/cla/individual/nicobustillos.md index 5e460b51c51ab..aac29668a5d24 100644 --- a/doc/cla/individual/nicobustillos.md +++ b/doc/cla/individual/nicobustillos.md @@ -8,4 +8,4 @@ declaration. Signed, -Nicolas Bustillos nicolas.bustillos@poiesisconsulting.com https://github.com/nicobustillos +Nicolas Bustillos nicobustillos@users.noreply.github.com https://github.com/nicobustillos