From 1ad8867deea179e3548f8f7619fd1bd11d1446ae Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 2 Jan 2018 15:46:30 +0100 Subject: [PATCH 01/18] [FIX] base: corrected automated action onchange and write When having an automated action which triggered upon changing a field to write on another (no python code, but operatiing with ir.server.object.lines) Before this commit, the onchange was not performed. This was because there was no active id (in fact the code did not take object() into consideration) After this commit, the onchange is performed. OPW 801424 --- odoo/addons/base/ir/ir_actions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_actions.py b/odoo/addons/base/ir/ir_actions.py index 993548e9c64..15a6371df88 100644 --- a/odoo/addons/base/ir/ir_actions.py +++ b/odoo/addons/base/ir/ir_actions.py @@ -851,7 +851,13 @@ class IrActionsServer(models.Model): else: ref_id = int(ref) - self.env[model].browse(ref_id).write(res) + if self._context.get('onchange_self'): + record_cached = self._context['onchange_self'] + for field, new_value in res.iteritems(): + record_cached[field] = new_value + else: + self.env[model].browse(ref_id).write(res) + @api.model def run_action_object_create(self, action, eval_context=None): @@ -975,6 +981,8 @@ class IrActionsServer(models.Model): elif hasattr(self, 'run_action_%s' % action.state): active_id = self._context.get('active_id') + if not active_id and self._context.get('onchange_self'): + active_id = self._context['onchange_self']._origin.id active_ids = self._context.get('active_ids', [active_id] if active_id else []) for active_id in active_ids: # run context dedicated to a particular active_id From ad78f115c31cf8cbe5cff5dbcbc766b5a0c3a0f9 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Tue, 9 Jan 2018 16:17:14 +0100 Subject: [PATCH 02/18] [ADD] doc: warning about function names in tests Closes #22116 --- doc/reference/testing.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/reference/testing.rst b/doc/reference/testing.rst index bff45196390..0495e896d8b 100644 --- a/doc/reference/testing.rst +++ b/doc/reference/testing.rst @@ -75,6 +75,10 @@ in each method:: # other tests... +.. note:: + + Test methods must start with `test_` + Running tests ------------- From eeea6e8667cfafc18e4966170d5dd6a6312aa40c Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Tue, 9 Jan 2018 10:38:15 +0100 Subject: [PATCH 03/18] [FIX] website_blog: don't copy visitor count of blogpost This commit closes #22107 and closes #22111 --- addons/website_blog/models/website_blog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py index 657ea5d8ff7..bc5de780976 100644 --- a/addons/website_blog/models/website_blog.py +++ b/addons/website_blog/models/website_blog.py @@ -133,7 +133,7 @@ class BlogPost(osv.Model): 'author_avatar': fields.related( 'author_id', 'image_small', string="Avatar", type="binary"), - 'visits': fields.integer('No of Views'), + 'visits': fields.integer('No of Views', copy=False), 'ranking': fields.function(_compute_ranking, string='Ranking', type='float'), } From eded3cfda8254034edf4fa86ddc11dce65b02f6c Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Wed, 10 Jan 2018 13:06:59 +0100 Subject: [PATCH 04/18] [FIX] website: check that website.user_id is not falsy This field should be required. This commits closes #21997 @kangol: diff in addons/website/models/ir_http.py is for existing db It can be ignored in master because required will be apply --- addons/website/models/ir_http.py | 2 +- addons/website/models/website.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index b8af335a17e..6b6f119fd88 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -40,7 +40,7 @@ class ir_http(orm.AbstractModel): def _auth_method_public(self): if not request.session.uid: website = self.pool['website'].get_current_website(request.cr, openerp.SUPERUSER_ID, context=request.context) - if website: + if website and website.user_id: request.uid = website.user_id.id else: request.uid = self.pool['ir.model.data'].xmlid_to_res_id(request.cr, openerp.SUPERUSER_ID, 'base', 'public_user') diff --git a/addons/website/models/website.py b/addons/website/models/website.py index aef827b86a8..b4b95f00ab5 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -166,7 +166,7 @@ class website(osv.osv): 'social_youtube': fields.char('Youtube Account'), 'social_googleplus': fields.char('Google+ Account'), 'google_analytics_key': fields.char('Google Analytics Key'), - 'user_id': fields.many2one('res.users', string='Public User'), + 'user_id': fields.many2one('res.users', string='Public User', required=True), 'compress_html': fields.boolean('Compress HTML'), 'cdn_activated': fields.boolean('Activate CDN for assets'), 'cdn_url': fields.char('CDN Base URL'), From 8fb203f7c692c0262a579575127b429e858ff3a2 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 10 Jan 2018 21:55:05 +0100 Subject: [PATCH 05/18] [FIX] base: ir_ui_view unescape %% in dev mode In dev mode with xml feature, we read the xml from file directly. %% should be unescape to get % instead. --- odoo/addons/base/ir/ir_ui_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_ui_view.py b/odoo/addons/base/ir/ir_ui_view.py index 2bef251ab86..61d679f8d90 100644 --- a/odoo/addons/base/ir/ir_ui_view.py +++ b/odoo/addons/base/ir/ir_ui_view.py @@ -201,7 +201,7 @@ actual arch. fullpath = get_resource_path(*view.arch_fs.split('/')) arch_fs = get_view_arch_from_file(fullpath, view.xml_id) # replace %(xml_id)s, %(xml_id)d, %%(xml_id)s, %%(xml_id)d by the res_id - arch_fs = arch_fs and resolve_external_ids(arch_fs, view.xml_id) + arch_fs = arch_fs and resolve_external_ids(arch_fs, view.xml_id).replace('%%', '%') view.arch = arch_fs or view.arch_db def _inverse_arch(self): From 330f84f21138343782000d375b4ce8daeb8907c7 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Thu, 11 Jan 2018 10:46:31 +0100 Subject: [PATCH 06/18] [FIX] l10n_fr_fec: fix format of Debit/Credit columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Numeric columns of fixed length should be left padded with '0' instead of ' ' (Article A47 A-1 Section III 2°) --- addons/l10n_fr_fec/wizard/fec.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/l10n_fr_fec/wizard/fec.py b/addons/l10n_fr_fec/wizard/fec.py index 00440affe2e..673b450b789 100644 --- a/addons/l10n_fr_fec/wizard/fec.py +++ b/addons/l10n_fr_fec/wizard/fec.py @@ -43,8 +43,8 @@ class AccountFrFec(models.TransientModel): '-' AS PieceRef, %s AS PieceDate, '/' AS EcritureLib, - replace(CASE WHEN COALESCE(sum(aml.balance), 0) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Debit, - replace(CASE WHEN COALESCE(sum(aml.balance), 0) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Credit, + replace(CASE WHEN COALESCE(sum(aml.balance), 0) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Debit, + replace(CASE WHEN COALESCE(sum(aml.balance), 0) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Credit, '' AS EcritureLet, '' AS DateLet, %s AS ValidDate, @@ -142,8 +142,8 @@ class AccountFrFec(models.TransientModel): '-' AS PieceRef, %s AS PieceDate, '/' AS EcritureLib, - replace(CASE WHEN sum(aml.balance) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Debit, - replace(CASE WHEN sum(aml.balance) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Credit, + replace(CASE WHEN sum(aml.balance) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Debit, + replace(CASE WHEN sum(aml.balance) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Credit, '' AS EcritureLet, '' AS DateLet, %s AS ValidDate, @@ -227,8 +227,8 @@ class AccountFrFec(models.TransientModel): '-' AS PieceRef, %s AS PieceDate, '/' AS EcritureLib, - replace(CASE WHEN sum(aml.balance) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Debit, - replace(CASE WHEN sum(aml.balance) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Credit, + replace(CASE WHEN sum(aml.balance) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Debit, + replace(CASE WHEN sum(aml.balance) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '000000000000000D99') END, '.', ',') AS Credit, '' AS EcritureLet, '' AS DateLet, %s AS ValidDate, @@ -289,14 +289,14 @@ class AccountFrFec(models.TransientModel): AS PieceRef, TO_CHAR(am.date, 'YYYYMMDD') AS PieceDate, CASE WHEN aml.name IS NULL THEN '/' ELSE replace(aml.name, '|', '/') END AS EcritureLib, - replace(CASE WHEN aml.debit = 0 THEN '0,00' ELSE to_char(aml.debit, '999999999999999D99') END, '.', ',') AS Debit, - replace(CASE WHEN aml.credit = 0 THEN '0,00' ELSE to_char(aml.credit, '999999999999999D99') END, '.', ',') AS Credit, + replace(CASE WHEN aml.debit = 0 THEN '0,00' ELSE to_char(aml.debit, '000000000000000D99') END, '.', ',') AS Debit, + replace(CASE WHEN aml.credit = 0 THEN '0,00' ELSE to_char(aml.credit, '000000000000000D99') END, '.', ',') AS Credit, CASE WHEN rec.name IS NULL THEN '' ELSE rec.name END AS EcritureLet, CASE WHEN aml.full_reconcile_id IS NULL THEN '' ELSE TO_CHAR(rec.create_date, 'YYYYMMDD') END AS DateLet, TO_CHAR(am.date, 'YYYYMMDD') AS ValidDate, CASE WHEN aml.amount_currency IS NULL OR aml.amount_currency = 0 THEN '' - ELSE replace(to_char(aml.amount_currency, '999999999999999D99'), '.', ',') + ELSE replace(to_char(aml.amount_currency, '000000000000000D99'), '.', ',') END AS Montantdevise, CASE WHEN aml.currency_id IS NULL THEN '' ELSE rc.name END AS Idevise FROM From cca12fbb08626094c24a245c5bf54dad2696fae7 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 10 Jan 2018 11:58:06 +0100 Subject: [PATCH 07/18] [FIX] payment_stripe: route receive wrong currency parameter This commit b335ae0348ac74b2edb6d5ea56cc230e276ef283 previously sent currency instead of currency_id on /website_payment/transaction route resulting in a cast error. Now, we send the currency_id as the route expect This closes #19468, closes #22165 --- addons/payment_stripe/static/src/js/stripe.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 14e19775747..9db27aea858 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -68,6 +68,7 @@ odoo.define('payment_stripe.stripe', function(require) { e.preventDefault(); if ($('.o_website_payment').length !== 0) { var currency = $("input[name='currency']").val(); + var currency_id = $("input[name='currency_id']").val(); var amount = parseFloat($("input[name='amount']").val() || '0.0'); if (!_.contains(int_currencies, currency)) { amount = amount*100; @@ -76,7 +77,7 @@ odoo.define('payment_stripe.stripe', function(require) { ajax.jsonRpc('/website_payment/transaction', 'call', { reference: $("input[name='invoice_num']").val(), amount: amount, - currency_id: currency, + currency_id: currency_id, acquirer_id: acquirer_id }) handler.open({ From 491404f053005b05d86b1a9b1c7b9705617ee521 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 10 Jan 2018 17:59:51 +0100 Subject: [PATCH 08/18] [FIX] website_event_track: day separation and tz An agenda for an event separates tracks by days and display them taking into account the event timezone. But when separating by day the timezone is not taken into account and a track could be displayed on the wrong day. opw-803610 closes #22170 --- addons/website_event_track/controllers/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/website_event_track/controllers/main.py b/addons/website_event_track/controllers/main.py index 0ef57e418ff..296ba70ecc6 100644 --- a/addons/website_event_track/controllers/main.py +++ b/addons/website_event_track/controllers/main.py @@ -55,11 +55,13 @@ class WebsiteEventTrackController(http.Controller): @http.route(['''/event/ Date: Thu, 11 Jan 2018 16:48:55 +0100 Subject: [PATCH 09/18] [IMP] ir_cron: use 'info' loglevel instead of 'debug' when starting job This information is important for `ir.cron` troubleshooting hence deserves a little more love. --- odoo/addons/base/ir/ir_cron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_cron.py b/odoo/addons/base/ir/ir_cron.py index 59653ae5183..b43d87d052c 100644 --- a/odoo/addons/base/ir/ir_cron.py +++ b/odoo/addons/base/ir/ir_cron.py @@ -243,7 +243,7 @@ class ir_cron(models.Model): _logger.debug("Job `%s` already executed by another process/thread. skipping it", job['name']) continue # Got the lock on the job row, run its code - _logger.debug('Starting job `%s`.', job['name']) + _logger.info('Starting job `%s`.', job['name']) job_cr = db.cursor() try: registry = odoo.registry(db_name) From 270b2ebf81036439b0b0e61fb32e737f98885001 Mon Sep 17 00:00:00 2001 From: Jerther Date: Fri, 16 Jun 2017 08:17:17 -0400 Subject: [PATCH 10/18] [FIX] service, web: memory error on large DB Fixes MemoryError when restoring large database archive. Closes #17663 opw-788273 --- addons/web/controllers/main.py | 9 +++++++-- odoo/service/db.py | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 1f95983c1ef..ab96ee293d4 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -17,6 +17,7 @@ import operator import os import re import sys +import tempfile import time import werkzeug.utils import werkzeug.wrappers @@ -37,6 +38,7 @@ from odoo.http import content_disposition, dispatch_rpc, request, \ serialize_exception as _serialize_exception from odoo.exceptions import AccessError, UserError from odoo.models import check_method_name +from odoo.service import db _logger = logging.getLogger(__name__) @@ -702,12 +704,15 @@ class Database(http.Controller): @http.route('/web/database/restore', type='http', auth="none", methods=['POST'], csrf=False) def restore(self, master_pwd, backup_file, name, copy=False): try: - data = base64.b64encode(backup_file.read()) - dispatch_rpc('db', 'restore', [master_pwd, name, data, str2bool(copy)]) + with tempfile.NamedTemporaryFile(delete=False) as data_file: + backup_file.save(data_file) + db.restore_db(name, data_file.name, str2bool(copy)) return http.local_redirect('/web/database/manager') except Exception, e: error = "Database restore error: %s" % (str(e) or repr(e)) return self._render_template(error=error) + finally: + os.unlink(data_file.name) @http.route('/web/database/change_password', type='http', auth="none", methods=['POST'], csrf=False) def change_password(self, master_pwd, master_pwd_new): diff --git a/odoo/service/db.py b/odoo/service/db.py index d322644e7ca..a90365c7201 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -211,9 +211,13 @@ def dump_db(db_name, stream, backup_format='zip'): return stdout def exp_restore(db_name, data, copy=False): + def chunks(d, n=8192): + for i in range(0, len(d), n): + yield d[i:i+n] data_file = tempfile.NamedTemporaryFile(delete=False) try: - data_file.write(data.decode('base64')) + for chunk in chunks(data): + data_file.write(chunk.decode('base64')) data_file.close() restore_db(db_name, data_file.name, copy=copy) finally: From bd00fa8dd1808478e70232dfcbd2f4b48f9e1cc8 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 11 Jan 2018 14:10:27 +0100 Subject: [PATCH 11/18] [FIX] web_editor: dbclick a video open MediaDialog with wrong media Before this commit: In the web editor, if you double clicked on a video iframe to edit it, it would open the MediaDialog(media) with the wrong media element. Media would be ' ' instead of '.media_iframe_video' (which is its grand parent): div.media_iframe_video div.css_editable_mode_display '& nbsp;' Then, if you changed the media by another one (Image or Video), the media would be wrongly inserted into the DOM, in the already existing iframe, eg: (1) div.media_iframe_video (2) div.css_editable_mode_display (3) div.media_iframe_video (4) div.css_editable_mode_display (5) '  ' Since the new media (3) is wrongly instered into (2) instead of replacing (1), the bug it would not be visible on normal mode (you would still see the old media) because (2) is not displayed on normal mode. Then on edit mode you would see both media one over the other. Note: This only happened when you opened MediaDialog thought double click directly (not 'Edit 'in navbar) and without clicking somewhere else after you entered edit mode. Now, if the media has an iframe parent, we use that parent as the correct media This closes #22109, closes #22179 Courtesy of QSM for the help --- addons/web_editor/static/src/js/rte.summernote.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 866d0d68e84..5f28c9510bb 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -398,7 +398,9 @@ eventHandler.modules.imageDialog.showImageDialog = function ($editable) { if (r.sc.tagName && r.sc.childNodes.length) { r.sc = r.sc.childNodes[r.so]; } - new widgets.MediaDialog(null, {}, $editable, dom.isImg(r.sc) ? r.sc : null).open(); + new widgets.MediaDialog(null, {}, $editable, $(r.sc).parents().addBack().filter(function (i, el) { + return dom.isImg(el); + })[0]).open(); return new $.Deferred().reject(); }; $.summernote.pluginEvents.alt = function (event, editor, layoutInfo, sorted) { From ea8cf1b7a22fd59fdc15281d0536d8e6137c77df Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 12 Jan 2018 11:31:10 +0100 Subject: [PATCH 12/18] [FIX] doc: escape code --- doc/reference/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/testing.rst b/doc/reference/testing.rst index 0495e896d8b..eb09a0647cc 100644 --- a/doc/reference/testing.rst +++ b/doc/reference/testing.rst @@ -77,7 +77,7 @@ in each method:: .. note:: - Test methods must start with `test_` + Test methods must start with ``test_`` Running tests ------------- From 4357783a5813ac3d28218cebd179a61e1b5b9b83 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 12 Jan 2018 10:40:10 +0100 Subject: [PATCH 13/18] [FIX] mass_mailing: width of main layout in editor Commit https://github.com/odoo/odoo/commit/bee3253b44850c0d563ee8973556ece33376781b changed the main layout width computation so that it is compatible with mail clients but broke the preview in the editor. --- addons/mass_mailing/static/src/less/themes/theme_default.less | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mass_mailing/static/src/less/themes/theme_default.less b/addons/mass_mailing/static/src/less/themes/theme_default.less index cfd1264e0c7..adfa4bba5ce 100644 --- a/addons/mass_mailing/static/src/less/themes/theme_default.less +++ b/addons/mass_mailing/static/src/less/themes/theme_default.less @@ -50,6 +50,7 @@ // ===== Layout ===== .o_layout { overflow: hidden; + box-sizing: content-box; width: 94%; min-height: 100%; background-color: @o_mm_def_color_alpha; From d5e97eab8b2465c968f5d2abaaabf8c33641dee6 Mon Sep 17 00:00:00 2001 From: tbe-odoo Date: Fri, 12 Jan 2018 11:30:18 +0100 Subject: [PATCH 14/18] [FIX] web: Kanban image not showing in some languages - In some languages the kanban images are not displayed because of a bug in human_size method in JS. This method translates the Unit Size for data and strip with the string with a comma as separator. When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result. This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit. Resulting in a bug in the method 'kanban_image'. opw #804973 #804970 #804648 --- addons/web/static/src/js/framework/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/framework/utils.js b/addons/web/static/src/js/framework/utils.js index c1b9758b625..3e9bd87f8de 100644 --- a/addons/web/static/src/js/framework/utils.js +++ b/addons/web/static/src/js/framework/utils.js @@ -288,7 +288,7 @@ function human_size (size) { size /= 1024; ++i; } - return size.toFixed(2) + ' ' + units[i]; + return size.toFixed(2) + ' ' + units[i].trim(); } /** From d0dbd570b628cc82183ddec6b78a49c88d4f12ef Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 12 Jan 2018 11:03:17 +0100 Subject: [PATCH 15/18] [FIX] mrp: digits in move.production.lots Add decimal precision to quantitites in stock.production.lots. Otherwise, if the UoM uses a DP larger than 2, inconsistencies may arise since the field is automatically rounded to 2 decimals in the interface. For example, if the DP of the UoM is 4: - Set Qty Done to 1.234567 - Save => qty recorded in DB is 1.234567 - Edit, change nothing and save => qty recorded in DB is 1.23 This happens since the web client parses the value in the DOM and detects a value change. opw-788078 --- addons/mrp/models/stock_move.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 6671cb0a215..661de7c93a9 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -18,9 +18,11 @@ class StockMoveLots(models.Model): 'stock.production.lot', 'Lot', domain="[('product_id', '=', product_id)]") lot_produced_id = fields.Many2one('stock.production.lot', 'Finished Lot') - lot_produced_qty = fields.Float('Quantity Finished Product', help="Informative, not used in matching") - quantity = fields.Float('To Do', default=1.0) - quantity_done = fields.Float('Done') + lot_produced_qty = fields.Float( + 'Quantity Finished Product', digits=dp.get_precision('Product Unit of Measure'), + help="Informative, not used in matching") + quantity = fields.Float('To Do', default=1.0, digits=dp.get_precision('Product Unit of Measure')) + quantity_done = fields.Float('Done', digits=dp.get_precision('Product Unit of Measure')) product_id = fields.Many2one( 'product.product', 'Product', readonly=True, related="move_id.product_id", store=True) From f166a3b69a516844618a0fa9e6b9e0ab0309ee39 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 12 Jan 2018 11:13:20 +0100 Subject: [PATCH 16/18] [FIX] website_blog: correct RSS feed Order blogs by post_date write_date is changed each time a new visitor reach the page (number of visit) Fixes tw:legalsylvain/status/951559451399671808 Closes #22198 --- addons/website_blog/controllers/main.py | 4 +++- addons/website_blog/views/website_blog_templates.xml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 27c7ff0754d..5a7f08216f1 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -177,7 +177,9 @@ class WebsiteBlog(http.Controller): v = {} v['blog'] = blog v['base_url'] = request.env['ir.config_parameter'].get_param('web.base.url') - v['posts'] = request.env['blog.post'].search([('blog_id','=', blog.id)], limit=min(int(limit), 50)) + v['posts'] = request.env['blog.post'].search([('blog_id','=', blog.id)], + limit=min(int(limit), 50), + order="post_date DESC") v['html2plaintext'] = html2plaintext r = request.render("website_blog.blog_feed", v, headers=[('Content-Type', 'application/atom+xml')]) return r diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index bcaa3a4c2aa..49a5210624f 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -552,14 +552,14 @@ <link t-att-href="'%s/blog/%s' % (base_url ,blog.id)"/> <id t-esc="'%s/blog/%s' % (base_url, blog.id)"/> - <updated t-esc="(posts[0] if posts else blog).write_date.replace(' ', 'T') + 'Z'"/> + <updated t-esc="(posts[0] if posts else blog).post_date.replace(' ', 'T') + 'Z'"/> <entry t-foreach="posts" t-as="post"> <title t-esc="post.name"/> <link t-att-href="'%s%s' % (base_url, post.website_url)"/> <id t-esc="'%s%s' % (base_url, post.website_url)"/> <author><name t-esc="post.sudo().author_id.name"/></author> <summary t-esc="html2plaintext(post.teaser)"/> - <updated t-esc="post.write_date.replace(' ', 'T') + 'Z'"/> + <updated t-esc="post.post_date.replace(' ', 'T') + 'Z'"/> </entry> </feed> </template> From 26d3b77a1de2472a7ce69210dc6aef7f7a615e69 Mon Sep 17 00:00:00 2001 From: Guillaume Masson <guillaume.masson@meta-it.fr> Date: Thu, 11 Jan 2018 21:30:40 +0100 Subject: [PATCH 17/18] [CLA] update CCLA for META IT To add github username Closes #22185 --- doc/cla/corporate/meta-it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cla/corporate/meta-it.md b/doc/cla/corporate/meta-it.md index 01b33f35c8b..f321433af3f 100644 --- a/doc/cla/corporate/meta-it.md +++ b/doc/cla/corporate/meta-it.md @@ -12,4 +12,4 @@ Robin Lucbenet robin@meta-it.fr https://github.com/n1b0r List of contributors: -Guillaume Masson guillaume.masson@meta-it.fr +Guillaume Masson guillaume.masson@meta-it.fr https://github.com/metaminux From aea2cafd1890428d3a6f6af3c02e8852f00818c1 Mon Sep 17 00:00:00 2001 From: Randall Castro <randall_castro@me.com> Date: Fri, 12 Jan 2018 08:19:50 -0600 Subject: [PATCH 18/18] [CLA] signature for rcastro-tyc Done at #22184 --- doc/cla/individual/rcastro-tyc.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/rcastro-tyc.md diff --git a/doc/cla/individual/rcastro-tyc.md b/doc/cla/individual/rcastro-tyc.md new file mode 100644 index 00000000000..ea6de8af17b --- /dev/null +++ b/doc/cla/individual/rcastro-tyc.md @@ -0,0 +1,11 @@ +Costa Rica, 2018-01-11 + +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, + +Randall Castro randall_castro@me.com https://github.com/rcastro-tyc