From 4305aad02fc76411209cbd432d7837b68bd39fbb Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 19 Feb 2015 12:30:45 +0100 Subject: [PATCH 1/5] [IMP] Packaging: version number in docker image name --- setup/package.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup/package.py b/setup/package.py index c9f60ed81f1..edfdcab8b94 100755 --- a/setup/package.py +++ b/setup/package.py @@ -304,17 +304,17 @@ def _prepare_testing(o): subprocess.call(["mkdir", "docker_debian"], cwd=o.build_dir) subprocess.call(["cp", "package.dfdebian", os.path.join(o.build_dir, "docker_debian", "Dockerfile")], cwd=os.path.join(o.odoo_dir, "setup")) - subprocess.call(["docker", "build", "-t", "openerp-debian-nightly-tests", "."], + subprocess.call(["docker", "build", "-t", "openerp-%s-debian-nightly-tests" % version, "."], cwd=os.path.join(o.build_dir, "docker_debian")) if not o.no_rpm: subprocess.call(["mkdir", "docker_centos"], cwd=o.build_dir) subprocess.call(["cp", "package.dfcentos", os.path.join(o.build_dir, "docker_centos", "Dockerfile")], cwd=os.path.join(o.odoo_dir, "setup")) - subprocess.call(["docker", "build", "-t", "openerp-centos-nightly-tests", "."], + subprocess.call(["docker", "build", "-t", "openerp-%s-centos-nightly-tests" % version, "."], cwd=os.path.join(o.build_dir, "docker_centos")) def test_tgz(o): - with docker('openerp-debian-nightly-tests', o.build_dir, o.pub) as wheezy: + with docker('openerp-%s-debian-nightly-tests' % version, o.build_dir, o.pub) as wheezy: wheezy.release = 'openerp.tar.gz' wheezy.system("service postgresql start") wheezy.system('pip install /opt/release/%s' % wheezy.release) @@ -327,7 +327,7 @@ def test_tgz(o): wheezy.system('su openerp -s /bin/bash -c "openerp-server --addons-path=/usr/local/lib/python2.7/dist-packages/openerp/addons -d mycompany &"') def test_deb(o): - with docker('openerp-debian-nightly-tests', o.build_dir, o.pub) as wheezy: + with docker('openerp-%s-debian-nightly-tests' % version, o.build_dir, o.pub) as wheezy: wheezy.release = '*.deb' wheezy.system("service postgresql start") wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"') @@ -337,7 +337,7 @@ def test_deb(o): wheezy.system('su openerp -s /bin/bash -c "openerp-server -c /etc/openerp/openerp-server.conf -d mycompany &"') def test_rpm(o): - with docker('openerp-centos-nightly-tests', o.build_dir, o.pub) as centos6: + with docker('openerp-%s-centos-nightly-tests' % version, o.build_dir, o.pub) as centos6: centos6.release = 'openerp.noarch.rpm' # Start postgresql centos6.system('su postgres -c "/usr/bin/pg_ctl -D /var/lib/postgres/data start"') From 121b8e6800498fa8939282ad1dd2db258a0b06b5 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 19 Feb 2015 15:09:49 +0100 Subject: [PATCH 2/5] [FIX] models: in onchange, false changes where detected in many2many fields This was due to secondary fields loaded from database in 'onchange' mode. In that mode, the secondary fields were marked 'dirty', and therefore returned by the method `onchange`. The fix consists in loading those secondary fields in cache before processing the onchanges. This incidentally fixes a test on method `onchange`: in a one2many field, some dirty fields were unexpectedly returned in the result. This was due to those fields being loaded while processing onchanges. --- openerp/addons/test_new_api/tests/test_onchange.py | 2 -- openerp/models.py | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openerp/addons/test_new_api/tests/test_onchange.py b/openerp/addons/test_new_api/tests/test_onchange.py index e9b7e1f83aa..3d0745a5f8b 100644 --- a/openerp/addons/test_new_api/tests/test_onchange.py +++ b/openerp/addons/test_new_api/tests/test_onchange.py @@ -146,8 +146,6 @@ class TestOnChange(common.TransactionCase): }), (1, message.id, { 'name': "[%s] %s" % ("Foo", USER.name), - # Note: size is computed because it was not provided beforehand - 'size': len(BODY), }), ]) diff --git a/openerp/models.py b/openerp/models.py index 3a8cb88423e..7dd628054a1 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -5787,6 +5787,11 @@ class BaseModel(object): # attach `self` with a different context (for cache consistency) record._origin = self.with_context(__onchange=True) + # load fields on secondary records, to avoid false changes + with env.do_in_onchange(): + for field_seq in secondary: + record.mapped(field_seq) + # determine which field(s) should be triggered an onchange todo = list(names) or list(values) done = set() From 8be57ccf0dda488937dbf59593336f5a3536faf7 Mon Sep 17 00:00:00 2001 From: Denis Michiels Date: Mon, 23 Feb 2015 11:17:05 +0100 Subject: [PATCH 3/5] [FIX] sale: Chatter entries translated in user language When a delivery order is confirmed, pass the user language to the procurement creation so the messages in the chatter are now translated in his language. opw 627002 --- addons/sale/sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 17712a931f2..b772bb7511f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -695,6 +695,8 @@ class sale_order(osv.osv): :return: True """ + context = dict(context) + context['lang'] = self.pool['res.users'].browse(cr, uid, uid).lang procurement_obj = self.pool.get('procurement.order') sale_line_obj = self.pool.get('sale.order.line') for order in self.browse(cr, uid, ids, context=context): From 0bbd8351f1126f2d9141200ce1519c99746a065c Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 23 Feb 2015 11:41:32 +0100 Subject: [PATCH 4/5] [FIX] web: on_item_action_clicked, self.dataset is not always defined. 27a48f8026f824f62955d5bf2a83b2799ad98db1 introduced the use of self.dataset It appears it is not always defined. Few lines above, self.getParent().dataset is used, and looks to be always defined. We therefore now use this dataset in order to get the context, to correctly pass the current session language. Closes #5416 --- addons/web/static/src/js/views.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 5ae8bfc79fc..009621cd27a 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1210,10 +1210,11 @@ instance.web.Sidebar = instance.web.Widget.extend({ instance.web.dialog($("
").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); return false; } + var dataset = self.getParent().dataset; var active_ids_context = { active_id: ids[0], active_ids: ids, - active_model: self.getParent().dataset.model + active_model: dataset.model }; var c = instance.web.pyeval.eval('context', new instance.web.CompoundContext( @@ -1221,7 +1222,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ self.rpc("/web/action/load", { action_id: item.action.id, context: new instance.web.CompoundContext( - self.dataset.get_context(), active_ids_context).eval() + dataset.get_context(), active_ids_context).eval() }).done(function(result) { result.context = new instance.web.CompoundContext( result.context || {}, active_ids_context) From 5d9fb7f1d1f80e7dae7538b8992b01fb4bd12cc3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 23 Feb 2015 11:58:48 +0100 Subject: [PATCH 5/5] [FIX] stock: picking report for picking without lines Even it is dummy, this is possible to create an empty picking, and to print it. We therefore must ensure no traceback is displayed. --- addons/stock/views/report_stockpicking.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/views/report_stockpicking.xml b/addons/stock/views/report_stockpicking.xml index f152e47a523..7fd4b9d08f9 100644 --- a/addons/stock/views/report_stockpicking.xml +++ b/addons/stock/views/report_stockpicking.xml @@ -27,12 +27,12 @@
-
+
Delivery Address:
-
+
Warehouse Address: