From cb5d41da3b236611506ad07efb3476b7f88ba36f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 14 Apr 2016 16:16:56 +0200 Subject: [PATCH 01/43] [FIX] account_asset: asset_create When creating assets from invoice lines, the system must check that assets have not already been created for the related invoice. If assets already exist then these assets have to be removed. Used case: - In the purchase journal, tick "allow canceling entries" - On a supplier invoice line, set an asset category - validate the invoice - cancel the invoice - set to draft - validate the invoice Before the fix: the asset was created twice. After the fix: A warning is raised if an asset already exists for the invoice. opw:674674 --- addons/account_asset/account_asset_invoice.py | 7 +++++++ addons/account_asset/i18n/account_asset.pot | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/addons/account_asset/account_asset_invoice.py b/addons/account_asset/account_asset_invoice.py index 38fea23fbe3..9212bc2f73c 100644 --- a/addons/account_asset/account_asset_invoice.py +++ b/addons/account_asset/account_asset_invoice.py @@ -19,7 +19,9 @@ # ############################################################################## +from openerp import SUPERUSER_ID from openerp.osv import fields, osv +from openerp.tools.translate import _ class account_invoice(osv.osv): @@ -45,6 +47,11 @@ class account_invoice_line(osv.osv): def asset_create(self, cr, uid, lines, context=None): context = context or {} asset_obj = self.pool.get('account.asset.asset') + for line in lines: + if line.invoice_id.number: + if asset_obj.search(cr, SUPERUSER_ID, [('code', '=', line.invoice_id.number)], context=context): + raise osv.except_osv(_('Warning!'), _('You already have assets with the reference %s.\nPlease delete these assets before creating new ones for this invoice.') % (line.invoice_id.number)) + for line in lines: if line.asset_category_id: vals = { diff --git a/addons/account_asset/i18n/account_asset.pot b/addons/account_asset/i18n/account_asset.pot index 8b7e9405ed5..56b547ebcdf 100644 --- a/addons/account_asset/i18n/account_asset.pot +++ b/addons/account_asset/i18n/account_asset.pot @@ -782,6 +782,12 @@ msgstr "" msgid "Year" msgstr "" +#. module: account_asset +#: code:addons/account_asset/account_asset_invoice.py:53 +#, python-format +msgid "You already have assets with the reference %s.\nPlease delete these assets before creating new ones for this invoice." +msgstr "" + #. module: account_asset #: code:addons/account_asset/account_asset.py:81 #, python-format From e18660c3308e7fb17590e72e6b5e9aadc8ca0517 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Fri, 8 Apr 2016 13:46:27 +0200 Subject: [PATCH 02/43] [FIX] web: fix iOS file downloading e8a00bc50da435d3859118ca127d20a2eb9a0cab moved the get_file function from web.session to web.ajax. The issue is that get_file uses session.url() for iOS devices. Also, in order to prevent an infinite spinner options.complete() is called before actually opening up the new window. Although this resolves the issue it still requires the user to configure Safari to allow pop-ups, otherwise they are silently ignored. opw-672882 --- addons/web/static/src/js/framework/ajax.js | 4 +++- addons/web/static/src/js/framework/session.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/framework/ajax.js b/addons/web/static/src/js/framework/ajax.js index 869e0214ad9..87fd08c7786 100644 --- a/addons/web/static/src/js/framework/ajax.js +++ b/addons/web/static/src/js/framework/ajax.js @@ -203,7 +203,9 @@ function get_file(options) { // opening a new window seems the best way to workaround if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { var params = _.extend({}, options.data || {}, {token: token}); - var url = this.url(options.url, params); + var url = options.session.url(options.url, params); + if (options.complete) { options.complete(); } + return window.open(url); } diff --git a/addons/web/static/src/js/framework/session.js b/addons/web/static/src/js/framework/session.js index 7eae8b20a65..e16b3767e64 100644 --- a/addons/web/static/src/js/framework/session.js +++ b/addons/web/static/src/js/framework/session.js @@ -271,6 +271,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, { if (this.override_session){ options.data.session_id = this.session_id; } + options.session = this; ajax.get_file(options); }, synchronized_mode: function(to_execute) { From 1df72cb01b9c6de0e417bdafb60b46d0276b7888 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 19 Apr 2016 11:35:45 +0200 Subject: [PATCH 03/43] [FIX] account: fixed query_get() when a domain is passed as argument (safe_eval must receive a string) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 01a3bcf0c1e..4490302194c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1147,7 +1147,7 @@ class AccountMoveLine(models.Model): @api.model def _query_get(self, domain=None): context = dict(self._context or {}) - domain = domain and safe_eval(domain) or [] + domain = domain and safe_eval(str(domain)) or [] date_field = 'date' if context.get('aged_balance'): From 7bde7b90161466fc8e6f451bc1fff3ec7b4153d3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 19 Apr 2016 15:02:08 +0200 Subject: [PATCH 04/43] [FIX] mail: `message_post` requires record write access By default, users are supposed to be able to write messages in threads only if they have the write access on the record. This behavior is the behavior defined in Odoo 8.0. This behavior can be changed by defining `_mail_post_access` on the model, to allow the creation of new messages if the user has only the read access, for instance. This is the case on `project.issue`, for instance. Since 9.0, @ revision 88b8cd058713bfad2942f7e7434c34b6c1a6e7da, this behavior was broken: Any users having the read access on the record was allowed to write messages in the thread, while this should not be the case, except if `_mail_post_access = 'read'` has been defined on the model. This is because the SQL query which is performed in order to know the thread messages the user has been notified of was expected to return only the ids of the notified message, while it actually always returned all the message ids of the thread, because of the LEFT JOINS, e.g. ``` LEFT JOIN "mail_message_res_partner_rel" partner_rel ON partner_rel.mail_message_id = m.id AND partner_rel.res_partner_id = (%%s) ``` Instead of just checking the ids of the messages returned by this query, it must check that one of the two columns `partner_rel.res_partner_id` or `channel_partner.partner_id` is filled, meaning the partner has been notified of the message or is a member of the channel the message has been posted to. opw-668589 --- addons/mail/models/mail_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 05224add86a..fe7d6d88448 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -762,7 +762,7 @@ class Message(models.Model): # TDE: probably clean me parent_ids = [message.get('parent_id') for mid, message in message_values.iteritems() if message.get('parent_id')] - self._cr.execute("""SELECT DISTINCT m.id FROM "%s" m + self._cr.execute("""SELECT DISTINCT m.id, partner_rel.res_partner_id, channel_partner.partner_id FROM "%s" m LEFT JOIN "mail_message_res_partner_rel" partner_rel ON partner_rel.mail_message_id = m.id AND partner_rel.res_partner_id = (%%s) LEFT JOIN "mail_message_mail_channel_rel" channel_rel @@ -772,7 +772,7 @@ class Message(models.Model): LEFT JOIN "mail_channel_partner" channel_partner ON channel_partner.channel_id = channel.id AND channel_partner.partner_id = (%%s) WHERE m.id = ANY (%%s)""" % self._table, (self.env.user.partner_id.id, self.env.user.partner_id.id, parent_ids,)) - not_parent_ids = [mid[0] for mid in self._cr.fetchall()] + not_parent_ids = [mid[0] for mid in self._cr.fetchall() if any([mid[1], mid[2]])] notified_ids += [mid for mid, message in message_values.iteritems() if message.get('parent_id') in not_parent_ids] From 04765d491750457ff571a7ede79fdc00d59b6fb3 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 24 Mar 2016 10:23:04 +0100 Subject: [PATCH 05/43] [FIX] hw_escpos: RBG images do not necessarily have an alpha channel --- addons/hw_escpos/escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 5087b392922..4051e65066c 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -445,7 +445,7 @@ class Escpos: img_rgba = Image.open(f) img = Image.new('RGB', img_rgba.size, (255,255,255)) channels = img_rgba.split() - if len(channels) > 1: + if len(channels) > 3: # use alpha channel as mask img.paste(img_rgba, mask=channels[3]) else: From 17d0117edc01c3c28f6c035f95b1975804f164a5 Mon Sep 17 00:00:00 2001 From: fossoult Date: Tue, 5 Apr 2016 11:16:55 +0200 Subject: [PATCH 06/43] [FIX] web: expose list view Column widget The list view Column widget should be exposed, so it can be extended. This is required to allow the creation of other kind of list widgets. The _format method is not extendable if we don't add this line. (comment from ged) The file list_view.js should be split in two, and reorganized, but this should not be done in 9.0. --- addons/web/static/src/js/views/list_view.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index cb6daf093ce..229ecb86d83 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -1901,6 +1901,7 @@ var Column = Class.extend({ row_data[this.id].value, this, options.value_if_empty)); } }); +ListView.Column = Column; var MetaColumn = Column.extend({ meta: true, From cd13ea99351f8eebf49ec811a5435ff103eb34e9 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Tue, 19 Apr 2016 15:51:25 +0200 Subject: [PATCH 07/43] [FIX] mail: race condition in mail composer When an user sends an email from the chatter then quickly switch to another record, it may happen that this.composer is already destroyed. We prevent to display a traceback with this fix. --- addons/mail/static/src/js/chatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index d57deed0802..2690d6c2444 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -919,7 +919,7 @@ var Chatter = form_common.AbstractField.extend({ this.mute_new_message_button(true); }, close_composer: function (force) { - if (this.composer.is_empty() || force) { + if (this.composer && (this.composer.is_empty() || force)) { this.composer.do_hide(); this.composer.$input.val(''); this.mute_new_message_button(false); From 7f6bd2dc666ca93c09df3131da2866ae2e4b13fa Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 19 Apr 2016 17:26:38 +0200 Subject: [PATCH 08/43] [FIX] web: fix layout issue in Chrome 50 (again) Makes the fix in f992c8ee192c075b38bf14dd5dcfb10fba7dd2ef specific to the view manager of the main oe_application container, in order to avoid disrupting other view manager occurrences (such as the ones in modal windows or x2many list views). Fixes #11629 (again) Note: Hopefully the Blink team will fix Chrome so we can get rid of this hack in the future: https://bugs.chromium.org/p/chromium/issues/detail?id=603507 --- addons/web/static/src/css/chrome50.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/css/chrome50.css b/addons/web/static/src/css/chrome50.css index cfcf6d84033..5279f10bfa4 100644 --- a/addons/web/static/src/css/chrome50.css +++ b/addons/web/static/src/css/chrome50.css @@ -3,6 +3,6 @@ display: table-cell; } -.oe_view_manager > .oe_view_manager_wrapper > div { +.openerp .oe_application > div > .oe_view_manager > .oe_view_manager_wrapper > div { display: table-cell; } From 999b2c7e329296b81b5e5f277d1bdb9b5d90f9f1 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 19 Apr 2016 18:12:31 +0200 Subject: [PATCH 09/43] [FIX] mrp: expected date of the manufactured product move This revision is related to eafebcb308a6214330479359ee00f460387df7d1 According to the `stock.move` fields definition: `date` is the "scheduled date until move is done, then date of actual move processing" `date_expected` is the "Scheduled date for the processing of this move" The scheduled date of the product being produced in a manufacturing order is the same scheduled date than written on the manufacturing order. opw-674237 --- addons/mrp/mrp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index fdf1b92c468..b94428f91fe 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1124,6 +1124,7 @@ class mrp_production(osv.osv): data = { 'name': production.name, 'date': production.date_planned, + 'date_expected': production.date_planned, 'product_id': production.product_id.id, 'product_uom': production.product_uom.id, 'product_uom_qty': production.product_qty, From 2a40c72ac1351d9768c29cfaf9467f018d6324da Mon Sep 17 00:00:00 2001 From: Yenthe Date: Mon, 11 Apr 2016 09:17:34 +0200 Subject: [PATCH 10/43] [CLA] signature for Van Roey corporate agreement This is the corporate agreement for Van Roey. Closes #11653 --- doc/cla/corporate/VanRoey.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/cla/corporate/VanRoey.md diff --git a/doc/cla/corporate/VanRoey.md b/doc/cla/corporate/VanRoey.md new file mode 100644 index 00000000000..956d6bb43a4 --- /dev/null +++ b/doc/cla/corporate/VanRoey.md @@ -0,0 +1,18 @@ +Belgium 2016-04-11 + +Van Roey 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, + +Yenthe Van Ginneken yenthe.vanginneken@vanroey.be https://github.com/Yenthe666 + +List of contributors: + +Yenthe Van Ginneken yenthe.vanginneken@vanroey.be https://github.com/Yenthe666 +Maarten Wijnants maarten.wijnants@vanroey.be https://github.com/weilant +Vincent Adriaensen vincent.adriaensen@vanroey.be https://github.com/vincentadriaensen +Pieter Paulussen pieter.paulussen@vanroey.be https://github.com/PieterPaulussen From ae594be59458d62e74a940fc7f485e48c8c89779 Mon Sep 17 00:00:00 2001 From: Cody K Date: Tue, 19 Apr 2016 09:12:03 -0400 Subject: [PATCH 11/43] [CLA] individual signature for tesserb Closes #11745 --- doc/cla/individual/tesserb.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/tesserb.md diff --git a/doc/cla/individual/tesserb.md b/doc/cla/individual/tesserb.md new file mode 100644 index 00000000000..ba4e41e2e42 --- /dev/null +++ b/doc/cla/individual/tesserb.md @@ -0,0 +1,11 @@ +United States, 2016-04-19 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Cody Kitterman ckitterm@gmail.com https://github.com/tesserb \ No newline at end of file From 1bb237174651c6a4f78f5719e0ef342d4157dc94 Mon Sep 17 00:00:00 2001 From: Cyril Gaudin Date: Fri, 15 Apr 2016 09:52:01 +0200 Subject: [PATCH 12/43] [CLA] add cyrilgdn to camptocamp signature Closes #11711 --- doc/cla/corporate/camptocamp.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/cla/corporate/camptocamp.md b/doc/cla/corporate/camptocamp.md index bb68262d95f..6e6d131fc2c 100644 --- a/doc/cla/corporate/camptocamp.md +++ b/doc/cla/corporate/camptocamp.md @@ -27,4 +27,5 @@ Romain Deheele romain.deheele@camptocamp.com https://github.com/rdeheele Maxime Wiot maxime.wiot@camptocamp.com https://github.com/maxime-c2c Ferdinand Gassauer ferdinand.gassauer@camptocamp.com https://github.com/ferdiga Jean-Baptiste Aubort jean-baptiste.aubort@camptocamp.com +Cyril Gaudin cyril.gaudin@camptocamp.com https://github.com/cyrilgdn From c225c78a3a032f6756e44a4d29bc1dd25fbbfa2e Mon Sep 17 00:00:00 2001 From: javcasas Date: Mon, 14 Mar 2016 15:15:06 -0500 Subject: [PATCH 13/43] [CLA] signature for Javier Casas Closes #11329 --- doc/cla/individual/javcasas.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/javcasas.md diff --git a/doc/cla/individual/javcasas.md b/doc/cla/individual/javcasas.md new file mode 100644 index 00000000000..0458f7754b1 --- /dev/null +++ b/doc/cla/individual/javcasas.md @@ -0,0 +1,11 @@ +Ecuador, 14th of March, 2016 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Javier Casas javcasas@gmail.com https://github.com/javcasas From bdfc75e613b45afcc5e9ada58f2d6c3d42b7732a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n?= Date: Fri, 11 Mar 2016 23:07:12 +0100 Subject: [PATCH 14/43] [CLA] coprorate signature by bisneSmart Closes #11312 --- doc/cla/corporate/bisneSmart.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/cla/corporate/bisneSmart.md diff --git a/doc/cla/corporate/bisneSmart.md b/doc/cla/corporate/bisneSmart.md new file mode 100644 index 00000000000..229c626f5c5 --- /dev/null +++ b/doc/cla/corporate/bisneSmart.md @@ -0,0 +1,16 @@ +Spain, March 11, 2016 + +bisneSmart S.C. 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, + +bisneSmart S.C. hola@bisnesmart.com https://github.com/bisnesmart + +List of contributors: + +Gonzalo Borrás Beta gborras@bisnesmart.com https://github.com/gonxi +Rubén Cabrera Martínez rcabrera@bisnesmart.com https://github.com/rubencabrera From 364e80f718869bc00ac22d22099bcb7c3d7ace7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Rodr=C3=ADguez=20Crespo?= Date: Fri, 8 Apr 2016 13:44:11 +0200 Subject: [PATCH 15/43] [CLA] signature for erocre Closes #11639 --- doc/cla/individual/erocre.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/cla/individual/erocre.md diff --git a/doc/cla/individual/erocre.md b/doc/cla/individual/erocre.md new file mode 100644 index 00000000000..a7a2aca53b0 --- /dev/null +++ b/doc/cla/individual/erocre.md @@ -0,0 +1,9 @@ +Spain, 2016-04-08 + +I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this declaration. + +Signed, + +Eduardo Rodriguez erocre@gmail.com https://github.com/erocre From 58d99909ec95577651a686162860040365181c09 Mon Sep 17 00:00:00 2001 From: Stephen Medina Date: Wed, 20 Apr 2016 09:12:50 +0200 Subject: [PATCH 16/43] [CLA] signature for stephen144 signature #11459 --- doc/cla/individual/stephen144.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/stephen144.md diff --git a/doc/cla/individual/stephen144.md b/doc/cla/individual/stephen144.md new file mode 100644 index 00000000000..5462fe58f1f --- /dev/null +++ b/doc/cla/individual/stephen144.md @@ -0,0 +1,11 @@ +United States of America, 2016-04-07 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Stephen Medina stephenm@lsm.org https://github.com/stephen144 From 92f1cbeb6f46a957a1f733d7ae8239dc35da57d4 Mon Sep 17 00:00:00 2001 From: Stephen Medina Date: Wed, 23 Mar 2016 13:57:39 -0700 Subject: [PATCH 17/43] [FIX] server: support psutils >= 4.0 In version 3, process.memory_info() returns only rss and vms In version 4, it now returns rss, vms, shared, text, lib, data and dirty Automatic unpacking is no longer possible in 4.0 Fixes #11052, Closes #11459 --- openerp/service/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index 50a7f7f2ee5..46c5c15fe1a 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -47,7 +47,8 @@ SLEEP_INTERVAL = 60 # 1 min def memory_info(process): """ psutil < 2.0 does not have memory_info, >= 3.0 does not have get_memory_info """ - return (getattr(process, 'memory_info', None) or process.get_memory_info)() + pmem = (getattr(process, 'memory_info', None) or process.get_memory_info)() + return (pmem.rss, pmem.vms) #---------------------------------------------------------- # Werkzeug WSGI servers patched From 21ccf2fe1c9ed2f6e16ded5f0e5751eebfc082e2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 20 Apr 2016 10:05:09 +0200 Subject: [PATCH 18/43] [FIX] stock: remove spaces surrounding the `/` in locations complete name The location name get is computed as: `parent.name + '/' + child.name` While, the complete was computed as: `parent.name + ' / ' + child.name` This leaded to an obvious inconsistency. Besides, this prevented to use the `location` filter in the search of the products list to know the quantity available of products for a specifc location, as the domain used to retrieve the locations is set as `[('complete_name','ilike',context['location'])]` `context['location']` containing the content of the `name_get` (No spaces surrounding `/`) and `complete_name` surrounding `/` with spaces. opw-674378 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 96937d3463d..dab4f6a3c16 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -61,7 +61,7 @@ class stock_location(osv.osv): res[m.id] = m.name parent = m.location_id while parent: - res[m.id] = parent.name + ' / ' + res[m.id] + res[m.id] = parent.name + '/' + res[m.id] parent = parent.location_id return res From 5c476513068813e676ab9e2a63c55ee9a45b67e1 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 20 Apr 2016 11:00:35 +0200 Subject: [PATCH 19/43] [FIX] sale: allow to import quotations without lines description When importing a quotation, if the lines `name`, `price_unit`, `product_uom` or `tax_id` are not specified, but the product is, retrieve them from the product `on_change` This was the case in Odoo 8.0, it was done as well in the override `create` method of `sale.order.line` opw-675434 --- addons/sale/sale.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c64676331f4..c9cdc6a5507 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -601,6 +601,13 @@ class SaleOrderLine(models.Model): @api.model def create(self, values): + onchange_fields = ['name', 'price_unit', 'product_uom', 'tax_id'] + if values.get('order_id') and values.get('product_id') and any(f not in values for f in onchange_fields): + line = self.new(values) + line.product_id_change() + for field in onchange_fields: + if field not in values: + values[field] = line._fields[field].convert_to_write(line[field]) line = super(SaleOrderLine, self).create(values) if line.state == 'sale': if (not line.order_id.project_id and From d043fd03ceca9935d910fb6e8393025a11984b1b Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Wed, 20 Apr 2016 10:04:06 +0200 Subject: [PATCH 20/43] [FIX] point_of_sale: display correct uom on weighable products Everything's displayed fine on orderlines with weighable products, this only affected the small blue labels on the products. opw-674264 --- addons/point_of_sale/static/src/xml/pos.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 196495dd624..a7d96b71d1b 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -751,7 +751,7 @@ - + From fc2aa7360691a7b6075337a4ee9cda762a98b433 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 20 Apr 2016 11:37:39 +0200 Subject: [PATCH 21/43] [FIX] web: fix db manager layout in Chrome 50 Complement of f992c8ee192c075b38bf14dd5dcfb10fba7dd2ef, to be reverted in saas-6+ and in 8.0 when Chrome's fix reaches the stable Chrome channel. Fixes #11629 See https://bugs.chromium.org/p/chromium/issues/detail?id=603507 --- addons/web/views/database_manager.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/views/database_manager.html b/addons/web/views/database_manager.html index 280fa81d901..924e9b9eb65 100644 --- a/addons/web/views/database_manager.html +++ b/addons/web/views/database_manager.html @@ -65,6 +65,14 @@