From 65ccb2871e7825430825308e6caafdd76c4b6396 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 11 May 2018 14:18:09 +0200 Subject: [PATCH] Add some 4.0 patches --- babi_multiprocess.diff | 25 ++++++++++++ issue3932.diff | 32 ++++++++++++++++ issue4030.diff | 12 ++++++ issue4341.diff | 72 +++++++++++++++++++++++++++++++++++ issue4482.diff | 19 +++++++++ issue4506.diff | 49 ++++++++++++++++++++++++ logging_jsonrpc_exeption.diff | 31 +++++++++++++++ series | 13 ++++++- 8 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 babi_multiprocess.diff create mode 100644 issue3932.diff create mode 100644 issue4030.diff create mode 100644 issue4341.diff create mode 100644 issue4482.diff create mode 100644 issue4506.diff create mode 100644 logging_jsonrpc_exeption.diff diff --git a/babi_multiprocess.diff b/babi_multiprocess.diff new file mode 100644 index 0000000..30bc38c --- /dev/null +++ b/babi_multiprocess.diff @@ -0,0 +1,25 @@ + diff -r cc988ec8da34 trytond/trytond/protocols/dispatcher.py + --- a/trytond/trytond/protocols/dispatcher.py Mon Apr 23 17:12:37 2018 +0200 + +++ b/trytond/trytond/protocols/dispatcher.py Fri May 11 12:53:17 2018 +0200 + @@ -122,8 +122,19 @@ + type, _ = method.split('.', 1) + name = '.'.join(method.split('.')[1:-1]) + method = method.split('.')[-1] + - return pool.get(name, type=type), method + - + + try: + + obj = pool.get(name, type=type) + + except KeyError: + + if name[:15] == 'babi_execution_': + + with Transaction().start(pool.database_name, request.user_id, + + readonly=False): + + Execution = pool.get('babi.report.execution') + + execution = Execution(int(name[15:])) + + execution.validate_model() + + obj = pool.get(name, type=type) + + else: + + raise + + return obj, method + + @app.auth_required + @with_pool diff --git a/issue3932.diff b/issue3932.diff new file mode 100644 index 0000000..cff5490 --- /dev/null +++ b/issue3932.diff @@ -0,0 +1,32 @@ + diff -r e978ecc8f044 trytond/trytond/modules/account/move.xml + --- a/trytond/trytond/modules/account/move.xml Mon Apr 23 17:24:11 2018 +0200 + +++ b/trytond/trytond/modules/account/move.xml Fri May 11 12:49:37 2018 +0200 + @@ -367,5 +367,28 @@ + account.move.general_journal + account/general_journal.fodt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/issue4030.diff b/issue4030.diff new file mode 100644 index 0000000..d752df5 --- /dev/null +++ b/issue4030.diff @@ -0,0 +1,12 @@ +diff -r 1329bfa523a8 trytond/trytond/modules/analytic_account/line.py +--- a/trytond/trytond/modules/analytic_account/line.py Mon Apr 23 17:28:19 2018 +0200 ++++ b/trytond/trytond/modules/analytic_account/line.py Fri May 11 13:16:07 2018 +0200 +@@ -28,7 +28,7 @@ + 'on_change_with_company', searcher='search_company') + account = fields.Many2One('analytic_account.account', 'Account', + required=True, select=True, domain=[ +- ('type', 'not in', ['view', 'distribution']), ++ ('type', 'not in', ['view', 'distribution', 'root']), + ['OR', + ('company', '=', None), + ('company', '=', Eval('company', -1)), diff --git a/issue4341.diff b/issue4341.diff new file mode 100644 index 0000000..a1e7df0 --- /dev/null +++ b/issue4341.diff @@ -0,0 +1,72 @@ +diff -r e978ecc8f044 trytond/trytond/modules/account/view/account_list.xml +--- a/trytond/trytond/modules/account/view/account_list.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/account_list.xml Fri May 11 14:15:10 2018 +0200 +@@ -5,4 +5,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/account_tree.xml +--- a/trytond/trytond/modules/account/view/account_tree.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/account_tree.xml Fri May 11 14:15:10 2018 +0200 +@@ -7,4 +7,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/journal_period_tree.xml +--- a/trytond/trytond/modules/account/view/journal_period_tree.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/journal_period_tree.xml Fri May 11 14:15:10 2018 +0200 +@@ -5,4 +5,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/journal_tree.xml +--- a/trytond/trytond/modules/account/view/journal_tree.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/journal_tree.xml Fri May 11 14:15:10 2018 +0200 +@@ -5,4 +5,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/move_template_list.xml +--- a/trytond/trytond/modules/account/view/move_template_list.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/move_template_list.xml Fri May 11 14:15:10 2018 +0200 +@@ -3,4 +3,5 @@ + this repository contains the full copyright notices and license terms. --> + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/tax_code_list.xml +--- a/trytond/trytond/modules/account/view/tax_code_list.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/tax_code_list.xml Fri May 11 14:15:10 2018 +0200 +@@ -5,4 +5,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/tax_code_tree.xml +--- a/trytond/trytond/modules/account/view/tax_code_tree.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/tax_code_tree.xml Fri May 11 14:15:10 2018 +0200 +@@ -7,4 +7,5 @@ + + + ++ + +diff -r e978ecc8f044 trytond/trytond/modules/account/view/tax_list.xml +--- a/trytond/trytond/modules/account/view/tax_list.xml Mon Apr 23 17:24:11 2018 +0200 ++++ b/trytond/trytond/modules/account/view/tax_list.xml Fri May 11 14:15:10 2018 +0200 +@@ -5,4 +5,5 @@ + + + ++ + diff --git a/issue4482.diff b/issue4482.diff new file mode 100644 index 0000000..adfab5e --- /dev/null +++ b/issue4482.diff @@ -0,0 +1,19 @@ +diff -r 98c229b8cb4a trytond/trytond/modules/stock/inventory.xml +--- a/trytond/trytond/modules/stock/inventory.xml Mon Apr 23 17:29:56 2018 +0200 ++++ b/trytond/trytond/modules/stock/inventory.xml Fri May 11 13:46:51 2018 +0200 +@@ -60,6 +60,15 @@ + inventory_line_tree + + ++ ++ ++ ++ ++ ++ ++ ++ + + + diff --git a/issue4506.diff b/issue4506.diff new file mode 100644 index 0000000..37e2d6a --- /dev/null +++ b/issue4506.diff @@ -0,0 +1,49 @@ +diff -r 9cd9f1c27fdd trytond/trytond/modules/account_invoice/invoice.xml +--- a/trytond/trytond/modules/account_invoice/invoice.xml Mon Apr 23 17:32:58 2018 +0200 ++++ b/trytond/trytond/modules/account_invoice/invoice.xml Fri May 11 13:11:48 2018 +0200 +@@ -132,6 +132,17 @@ + + ++ ++ Credit Notes ++ account.invoice ++ ++ ++ ++ form_relate ++ account.invoice,-1 ++ ++ ++ + + + +diff -r 9cd9f1c27fdd trytond/trytond/modules/account_invoice/locale/ca.po +--- a/trytond/trytond/modules/account_invoice/locale/ca.po Mon Apr 23 17:32:58 2018 +0200 ++++ b/trytond/trytond/modules/account_invoice/locale/ca.po Fri May 11 13:11:48 2018 +0200 +@@ -1127,6 +1127,10 @@ + msgid "Invoice Tax" + msgstr "Impost de factura" + ++msgctxt "model:ir.action,name:act_credit_notes_form" ++msgid "Credit Notes" ++msgstr "Abonaments" ++ + msgctxt "model:ir.action,name:act_invoice_form" + msgid "Invoices" + msgstr "Factures" +diff -r 9cd9f1c27fdd trytond/trytond/modules/account_invoice/locale/es.po +--- a/trytond/trytond/modules/account_invoice/locale/es.po Mon Apr 23 17:32:58 2018 +0200 ++++ b/trytond/trytond/modules/account_invoice/locale/es.po Fri May 11 13:11:48 2018 +0200 +@@ -1123,6 +1123,10 @@ + msgid "Invoice Tax" + msgstr "Impuesto de factura" + ++msgctxt "model:ir.action,name:act_credit_notes_form" ++msgid "Credit Notes" ++msgstr "Abonos" ++ + msgctxt "model:ir.action,name:act_invoice_form" + msgid "Invoices" + msgstr "Facturas" diff --git a/logging_jsonrpc_exeption.diff b/logging_jsonrpc_exeption.diff new file mode 100644 index 0000000..d3f9e31 --- /dev/null +++ b/logging_jsonrpc_exeption.diff @@ -0,0 +1,31 @@ +diff -r 7ed03689fe01 trytond/trytond/protocols/dispatcher.py +--- a/trytond/trytond/protocols/dispatcher.py Fri May 11 13:52:50 2018 +0200 ++++ b/trytond/trytond/protocols/dispatcher.py Fri May 11 13:56:27 2018 +0200 +@@ -192,7 +192,7 @@ + raise + except (ConcurrencyException, UserError, UserWarning, + LoginException): +- logger.debug(log_message, *log_args, exc_info=True) ++ logger.warning(log_message, *log_args, exc_info=True) + raise + except Exception: + logger.error(log_message, *log_args, exc_info=True) +diff -r 7ed03689fe01 trytond/trytond/protocols/jsonrpc.py +--- a/trytond/trytond/protocols/jsonrpc.py Fri May 11 13:52:50 2018 +0200 ++++ b/trytond/trytond/protocols/jsonrpc.py Fri May 11 13:56:27 2018 +0200 +@@ -4,6 +4,7 @@ + from decimal import Decimal + import json + import base64 ++import logging + + from werkzeug.wrappers import Response + from werkzeug.utils import cached_property +@@ -12,6 +13,8 @@ + from trytond.protocols.wrappers import Request + from trytond.exceptions import TrytonException + ++logger = logging.getLogger(__name__) ++ + + class JSONDecoder(object): diff --git a/series b/series index 8d5c2ed..6b2c990 100644 --- a/series +++ b/series @@ -1 +1,12 @@ -issue6253.diff # add invoice type criteria +babi_multiprocess.diff # [trytond] babi multiprocess +logging_jsonrpc_exeption.diff # [trytond] logging JSONRPC Exception + +issue3932.diff # [account] rule account move and account move line by company +issue4341.diff # [account] Add active invisible in tree/list views + +issue6253.diff # [account_invoice] add invoice type criteria +issue4506.diff # [account_invoice] Add credit invoices keyword from account.invoice + +issue4030.diff # [analytic_account] Not selected root accounts in analytic account lines + +issue4482.diff # [stock] stock inventory misses company access rule