summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-17 10:54:19 +0200
committerChristophe Simonis <chs@odoo.com>2018-10-17 10:54:19 +0200
commite9ae419fca0a9ebd0071c280bd98fc84f268bb74 (patch)
tree8f33c2a81a60133b04df10d7e81afbc9d54c20a6 /odoo
parent156d099e328304d0f19146f4714d13b7b572358a (diff)
parent0de06a41326662d4505401764035bf9ddf31fc8b (diff)
[MERGE] forward port branch saas-11.3 up to 0de06a41326
Diffstat (limited to 'odoo')
-rw-r--r--odoo/addons/base/data/res_country_data.xml4
-rw-r--r--odoo/addons/base/models/ir_http.py2
-rw-r--r--odoo/addons/base/models/ir_ui_view.py7
-rw-r--r--odoo/addons/base/security/ir.model.access.csv2
-rw-r--r--odoo/addons/base/tests/test_ir_http.py14
-rw-r--r--odoo/tools/config.py2
6 files changed, 20 insertions, 11 deletions
diff --git a/odoo/addons/base/data/res_country_data.xml b/odoo/addons/base/data/res_country_data.xml
index 3e0db583e3e..d924f2ee042 100644
--- a/odoo/addons/base/data/res_country_data.xml
+++ b/odoo/addons/base/data/res_country_data.xml
@@ -457,7 +457,7 @@
<field name="name">Ecuador</field>
<field name="code">ec</field>
<field file="base/static/img/country_flags/ec.png" name="image" type="base64" />
- <field name="currency_id" ref="ECS" />
+ <field name="currency_id" ref="USD" />
<field eval="593" name="phone_code" />
</record>
<record id="ee" model="res.country">
@@ -1734,7 +1734,7 @@
<field file="base/static/img/country_flags/vn.png" name="image" type="base64" />
<field name="currency_id" ref="VND" />
<field eval="84" name="phone_code" />
- <field eval="'%(street)s\n%(street2)s\n%(city)s\n%(name)s %(zip)s %(country_name)s'" name="address_format" />
+ <field eval="'%(street)s\n%(street2)s\n%(city)s\n%(state_name)s %(country_name)s'" name="address_format" />
</record>
<record id="vu" model="res.country">
<field name="name">Vanuatu</field>
diff --git a/odoo/addons/base/models/ir_http.py b/odoo/addons/base/models/ir_http.py
index eab07d2768e..fc0fadd9a59 100644
--- a/odoo/addons/base/models/ir_http.py
+++ b/odoo/addons/base/models/ir_http.py
@@ -288,7 +288,7 @@ class IrHttp(models.AbstractModel):
# access token grant access
if model == 'ir.attachment' and access_token:
obj = obj.sudo()
- if not consteq(obj.access_token or '', access_token):
+ if not consteq(obj.access_token or u'', access_token):
return (403, [], None)
# check read access
diff --git a/odoo/addons/base/models/ir_ui_view.py b/odoo/addons/base/models/ir_ui_view.py
index 028418b0118..71b435f483f 100644
--- a/odoo/addons/base/models/ir_ui_view.py
+++ b/odoo/addons/base/models/ir_ui_view.py
@@ -127,6 +127,13 @@ def get_view_arch_from_file(filename, xmlid):
if node.tag in ('template', 'record'):
if node.tag == 'record':
field = node.find('field[@name="arch"]')
+ if field is None:
+ if node.find('field[@name="view_id"]') is not None:
+ view_id = node.find('field[@name="view_id"]').attrib.get('ref')
+ ref_id = '%s%s' % ('.' not in view_id and xmlid.split('.')[0] + '.' or '', view_id)
+ return get_view_arch_from_file(filename, ref_id)
+ else:
+ return None
_fix_multiple_roots(field)
inner = u''.join([etree.tostring(child, encoding='unicode') for child in field.iterchildren()])
return field.text + inner
diff --git a/odoo/addons/base/security/ir.model.access.csv b/odoo/addons/base/security/ir.model.access.csv
index 579390d9e4c..380dda058fd 100644
--- a/odoo/addons/base/security/ir.model.access.csv
+++ b/odoo/addons/base/security/ir.model.access.csv
@@ -95,4 +95,4 @@
"access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0
"access_ir_logging","ir_logging admin","model_ir_logging","group_erp_manager",1,1,1,1
"paperformat_access_portal","ir_actions_report_paperformat group_portal","model_report_paperformat",,1,0,0,0
-"paperformat_access_employee","ir_actions_report_paperformat group_hr_user","model_report_paperformat",,1,0,1,0
+"paperformat_access_employee","ir_actions_report_paperformat group_system","model_report_paperformat",group_system,1,1,1,1
diff --git a/odoo/addons/base/tests/test_ir_http.py b/odoo/addons/base/tests/test_ir_http.py
index 2cdcaf74dcf..4853c808fe4 100644
--- a/odoo/addons/base/tests/test_ir_http.py
+++ b/odoo/addons/base/tests/test_ir_http.py
@@ -97,29 +97,29 @@ class test_ir_http_mimetype(common.TransactionCase):
def test_access(**kwargs):
status, _, _ = self.env['ir.http'].binary_content(
- **defaults, **kwargs
+ **dict(defaults, **kwargs)
)
return status
status = test_access()
self.assertEqual(status, 403, "no access")
- status = test_access(access_token='Secret')
+ status = test_access(access_token=u'Secret')
self.assertEqual(status, 403,
"no access if access token for attachment without access token")
- attachment.access_token = 'Secret'
- status = test_access(access_token='Secret')
+ attachment.access_token = u'Secret'
+ status = test_access(access_token=u'Secret')
self.assertEqual(status, 200, "access for correct access token")
- status = test_access(access_token='Wrong')
+ status = test_access(access_token=u'Wrong')
self.assertEqual(status, 403, "no access for wrong access token")
attachment.public = True
status = test_access()
self.assertEqual(status, 200, "access for attachment with access")
- status = test_access(access_token='Wrong')
+ status = test_access(access_token=u'Wrong')
self.assertEqual(status, 403,
"no access for wrong access token for attachment with access")
@@ -127,6 +127,6 @@ class test_ir_http_mimetype(common.TransactionCase):
status = test_access()
self.assertEqual(status, 404, "no access for deleted attachment")
- status = test_access(access_token='Secret')
+ status = test_access(access_token=u'Secret')
self.assertEqual(status, 404,
"no access with access token for deleted attachment")
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index 343aa6cf5a9..d9678cb4994 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -468,6 +468,8 @@ class configmanager(object):
os.path.abspath(os.path.expanduser(os.path.expandvars(x.strip())))
for x in self.options['addons_path'].split(','))
+ self.options['data_dir'] = os.path.abspath(os.path.expanduser(os.path.expandvars(self.options['data_dir'].strip())))
+
self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {}
self.options['demo'] = (dict(self.options['init'])
if not self.options['without_demo'] else {})