Add some 4.0 patches

This commit is contained in:
Raimon Esteve 2018-05-11 14:18:09 +02:00
parent e47c16f36f
commit 65ccb2871e
8 changed files with 252 additions and 1 deletions

25
babi_multiprocess.diff Normal file
View File

@ -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

32
issue3932.diff Normal file
View File

@ -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 @@
<field name="report_name">account.move.general_journal</field>
<field name="report">account/general_journal.fodt</field>
</record>
+
+ <!-- ir rule account move and account move line by company -->
+ <record model="ir.rule.group" id="rule_group_account_move">
+ <field name="model" search="[('model', '=', 'account.move')]"/>
+ <field name="global_p" eval="True"/>
+ </record>
+ <record model="ir.rule" id="rule_account_move1">
+ <field name="domain"
+ eval="[('company', '=', Eval('user', {}).get('company', None))]"
+ pyson="1"/>
+ <field name="rule_group" ref="rule_group_account_move"/>
+ </record>
+
+ <record model="ir.rule.group" id="rule_group_account_move_line">
+ <field name="model" search="[('model', '=', 'account.move.line')]"/>
+ <field name="global_p" eval="True"/>
+ </record>
+ <record model="ir.rule" id="rule_account_move_line1">
+ <field name="domain"
+ eval="[('move.company', '=', Eval('user', {}).get('company', None))]"
+ pyson="1"/>
+ <field name="rule_group" ref="rule_group_account_move_line"/>
+ </record>
</data>
</tryton>

12
issue4030.diff Normal file
View File

@ -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)),

72
issue4341.diff Normal file
View File

@ -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 @@
<field name="rec_name"/>
<field name="company"/>
<field name="type"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="type"/>
<field name="parent" tree_invisible="1"/>
<field name="childs" tree_invisible="1"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="journal"/>
<field name="period"/>
<field name="state"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="name"/>
<field name="code"/>
<field name="type"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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. -->
<tree>
<field name="name"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="name"/>
<field name="code"/>
<field name="company"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="company"/>
<field name="parent" tree_invisible="1"/>
<field name="childs" tree_invisible="1"/>
+ <field name="active" tree_invisible="1"/>
</tree>
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 @@
<field name="name"/>
<field name="group"/>
<field name="type"/>
+ <field name="active" tree_invisible="1"/>
</tree>

19
issue4482.diff Normal file
View File

@ -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 @@
<field name="name">inventory_line_tree</field>
</record>
+ <record model="ir.rule.group" id="rule_group_inventory">
+ <field name="model" search="[('model', '=', 'stock.inventory')]"/>
+ <field name="global_p" eval="True"/>
+ </record>
+ <record model="ir.rule" id="rule_inventory">
+ <field name="domain" eval="[('company', 'in', Eval('user', {}).get('companies', []))]" p
+ <field name="rule_group" ref="rule_group_inventory"/>
+ </record>
+
<record model="ir.model.access" id="access_inventory">
<field name="model" search="[('model', '=', 'stock.inventory')]"/>
<field name="perm_read" eval="False"/>

49
issue4506.diff Normal file
View File

@ -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 @@
<menuitem parent="menu_invoices" action="act_invoice_in_form"
id="menu_invoice_in_form" sequence="3"/>
+ <record model="ir.action.act_window" id="act_credit_notes_form">
+ <field name="name">Credit Notes</field>
+ <field name="res_model">account.invoice</field>
+ <field name="domain" eval="[('lines.origin.invoice', 'in', Eval('active_ids'), 'account.invoice.line')]" pyson="1"/>
+ </record>
+ <record model="ir.action.keyword" id="act_open_credit_notes_keyword1">
+ <field name="keyword">form_relate</field>
+ <field name="model">account.invoice,-1</field>
+ <field name="action" ref="act_credit_notes_form"/>
+ </record>
+
<record model="ir.model.access" id="access_invoice">
<field name="model" search="[('model', '=', 'account.invoice')]"/>
<field name="perm_read" eval="False"/>
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"

View File

@ -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):

13
series
View File

@ -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