From 466ca1e07e6373d3683ad6b2b9245ffd52195e1c Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Tue, 14 Nov 2017 11:28:07 +0100 Subject: [PATCH 01/11] [FIX] web: handle SessionExpiredException in the crash_manager --- addons/web/static/src/js/framework/crash_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/framework/crash_manager.js b/addons/web/static/src/js/framework/crash_manager.js index bc9046f5719..831f762b78c 100644 --- a/addons/web/static/src/js/framework/crash_manager.js +++ b/addons/web/static/src/js/framework/crash_manager.js @@ -54,7 +54,7 @@ var CrashManager = core.Class.extend({ new (handler)(this, error).display(); return; } - if (error.data.name === "openerp.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") { + if (error.data.name === "odoo.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") { this.show_warning({type: "Session Expired", data: { message: _t("Your Odoo session expired. Please refresh the current web page.") }}); return; } From 73f0c6da6d60c308006f34e81573179bc1efda71 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 8 Nov 2017 15:20:18 +0100 Subject: [PATCH 02/11] [FIX] l10n_fr_fec: Receivable/Payable In the FEC report, opening entries on receivable and payable accounts should be split by partner. opw-781321 --- addons/l10n_fr_fec/wizard/fec.py | 61 +++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/addons/l10n_fr_fec/wizard/fec.py b/addons/l10n_fr_fec/wizard/fec.py index d56762b537c..00440affe2e 100644 --- a/addons/l10n_fr_fec/wizard/fec.py +++ b/addons/l10n_fr_fec/wizard/fec.py @@ -169,8 +169,9 @@ class AccountFrFec(models.TransientModel): ''' sql_query += ''' - GROUP BY aml.account_id + GROUP BY aml.account_id, aat.type HAVING sum(aml.balance) != 0 + AND aat.type not in ('receivable', 'payable') ''' formatted_date_from = self.date_from.replace('-', '') date_from = datetime.strptime(self.date_from, DEFAULT_SERVER_DATE_FORMAT) @@ -208,6 +209,64 @@ class AccountFrFec(models.TransientModel): unaffected_earnings_results[5] = unaffected_earnings_account.name w.writerow([s.encode("utf-8") for s in unaffected_earnings_results]) + # INITIAL BALANCE - receivable/payable + sql_query = ''' + SELECT + 'OUV' AS JournalCode, + 'Balance initiale' AS JournalLib, + 'OUVERTURE/' || %s AS EcritureNum, + %s AS EcritureDate, + MIN(aa.code) AS CompteNum, + replace(MIN(aa.name), '|', '/') AS CompteLib, + CASE WHEN rp.ref IS null OR rp.ref = '' + THEN COALESCE('ID ' || rp.id, '') + ELSE rp.ref + END + AS CompAuxNum, + COALESCE(replace(rp.name, '|', '/'), '') AS CompAuxLib, + '-' 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, + '' AS EcritureLet, + '' AS DateLet, + %s AS ValidDate, + '' AS Montantdevise, + '' AS Idevise, + MIN(aa.id) AS CompteID + FROM + account_move_line aml + LEFT JOIN account_move am ON am.id=aml.move_id + LEFT JOIN res_partner rp ON rp.id=aml.partner_id + JOIN account_account aa ON aa.id = aml.account_id + LEFT JOIN account_account_type aat ON aa.user_type_id = aat.id + WHERE + am.date < %s + AND am.company_id = %s + AND aat.include_initial_balance = 't' + AND (aml.debit != 0 OR aml.credit != 0) + ''' + + # For official report: only use posted entries + if self.export_type == "official": + sql_query += ''' + AND am.state = 'posted' + ''' + + sql_query += ''' + GROUP BY aml.account_id, aat.type, rp.ref, rp.id + HAVING sum(aml.balance) != 0 + AND aat.type in ('receivable', 'payable') + ''' + self._cr.execute( + sql_query, (formatted_date_year, formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id)) + + for row in self._cr.fetchall(): + listrow = list(row) + account_id = listrow.pop() + w.writerow([s.encode("utf-8") for s in listrow]) + # LINES sql_query = ''' SELECT From 97eb4a36b0a0b1004e8c49d5a457360ea3d4cdcb Mon Sep 17 00:00:00 2001 From: "Jonathan Nemry (METRUM)" Date: Tue, 14 Nov 2017 15:03:27 +0100 Subject: [PATCH 03/11] [CLA] METRUM signature of Corporate CLA 1.0 Done at #20926 --- doc/cla/corporate/metrum.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/cla/corporate/metrum.md diff --git a/doc/cla/corporate/metrum.md b/doc/cla/corporate/metrum.md new file mode 100644 index 00000000000..b64bf351a8b --- /dev/null +++ b/doc/cla/corporate/metrum.md @@ -0,0 +1,16 @@ +Belgium, 2017-11-14 + +METRUM SA 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, + +Jonathan Nemry jonathan.nemry@metrum.lu https://github.com/JonathanNEMRY + +List of contributors: + +Pascal Pelzer pascal.pelzer@metrum.lu https://github.com/PascalPelzer +Jonathan Nemry jonathan.nemry@metrum.lu https://github.com/JonathanNEMRY From b152c5be4faaca651e1fe0173e66d330291cef98 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 14 Nov 2017 15:36:58 +0100 Subject: [PATCH 04/11] [FIX] im_livechat: Creation date (hour) Go to Report -> Operator Analysis -> Apply group_by 'Creation date (hour)' => traceback. `start_date_hour` is implemented for Livechat Support Report on Channels, but not on Operators. opw-782255 --- addons/im_livechat/report/im_livechat_report_operator_views.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/im_livechat/report/im_livechat_report_operator_views.xml b/addons/im_livechat/report/im_livechat_report_operator_views.xml index 902a16ab1ac..773229b2577 100644 --- a/addons/im_livechat/report/im_livechat_report_operator_views.xml +++ b/addons/im_livechat/report/im_livechat_report_operator_views.xml @@ -36,7 +36,6 @@ - From 1662088ed649ba33645797457cba06d83f30d089 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 14 Nov 2017 15:55:28 +0100 Subject: [PATCH 05/11] [FIX] mrp: product name Complement of commit ea96aa167634281511dfe2 to raw materials. opw-781039 --- addons/mrp/report/mrp_production_templates.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mrp/report/mrp_production_templates.xml b/addons/mrp/report/mrp_production_templates.xml index d8a90b371ac..13fd06a4477 100644 --- a/addons/mrp/report/mrp_production_templates.xml +++ b/addons/mrp/report/mrp_production_templates.xml @@ -93,8 +93,7 @@ - - + From 5297321207c2d45f8bb1c3e6f692fbde93148f0f Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Mon, 13 Nov 2017 13:27:02 +0100 Subject: [PATCH 06/11] [FIX] website_sale: 0.00 total is showing in empty cart if logged in Before this commit, if you go on /shop/cart and your cart is empty, it will show the total (Subtotal, Taxes, Total) as $ 0.00. Indeed, the code is retrieving a 'sale.order' if you are connected and you already have a draft sale order on DB (eg: you just add something to cart and emptied it afterward). - Add product to your cart and proceed to checkout - On checkout cart, remove the product, your cart is now empty - Reload the page (you should still be on /shop/cart) or go to /shop/cart - You now see the zero prices (Subtotal, Taxes, Total) Now, we will hide this if you have an order but no line on that order. This closes #20896 --- addons/website_sale/views/templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 663f57f8b5e..b260d26af7e 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -1396,7 +1396,7 @@