summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-02 10:52:55 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-02 10:52:55 +0100
commit5e055a2afd23bd4e6a29c18c86d1978dcd98fc9f (patch)
tree058c2cef359de70f7bbabacaa63446fa189af12e /odoo
parent486777654009aa372a21e9d6dd52e8c22173ee16 (diff)
parentf6ca72b3ce9ecc9007ae5825d2c648e3b26b098e (diff)
[MERGE] forward port branch saas-11.4 up to f6ca72b3ce9
Diffstat (limited to 'odoo')
-rw-r--r--odoo/addons/base/data/res.lang.csv2
-rw-r--r--odoo/addons/base/data/res_currency_data.xml3
-rw-r--r--odoo/addons/base/models/ir_module.py7
-rw-r--r--odoo/addons/base/models/res_config.py15
-rw-r--r--odoo/models.py2
-rw-r--r--odoo/modules/migration.py4
-rw-r--r--odoo/tests/common.py3
7 files changed, 21 insertions, 15 deletions
diff --git a/odoo/addons/base/data/res.lang.csv b/odoo/addons/base/data/res.lang.csv
index 2c86f47f72b..3a0ccc3e07d 100644
--- a/odoo/addons/base/data/res.lang.csv
+++ b/odoo/addons/base/data/res.lang.csv
@@ -61,7 +61,7 @@ base.lang_my,"Burmese / ဗမာစာ",my_MM,my,"Left-to-Right","[3,3]",".",",
"base.lang_es_CL","Spanish (CL) / Español (CL)","es_CL","es_CL","Left-to-Right","[3,0]",",",".","%d/%m/%Y","%H:%M:%S","True","1"
"base.lang_es_CO","Spanish (CO) / Español (CO)","es_CO","es_CO","Left-to-Right","[3,0]",",",".","%d-%m-%Y","%H:%M:%S","True","7"
"base.lang_es_CR","Spanish (CR) / Español (CR)","es_CR","es_CR","Left-to-Right","[3,0]",","," ","%d/%m/%Y","%H:%M:%S","True","1"
-"base.lang_es_DO","Spanish (DO) / Español (DO)","es_DO","es_DO","Left-to-Right","[3,0]",".",",","%d/%m/%Y","%H:%M:%S","True","1"
+"base.lang_es_DO","Spanish (DO) / Español (DO)","es_DO","es_DO","Left-to-Right","[3,0]",".",",","%d/%m/%Y","%I:%M:%S %p","True","1"
"base.lang_es_EC","Spanish (EC) / Español (EC)","es_EC","es_EC","Left-to-Right","[3,0]",",",".","%d/%m/%Y","%H:%M:%S","True","1"
"base.lang_es_GT","Spanish (GT) / Español (GT)","es_GT","es_GT","Left-to-Right","[3,0]",".",",","%d/%m/%Y","%H:%M:%S","True","7"
"base.lang_es_MX","Spanish (MX) / Español (MX)","es_MX","es_MX","Left-to-Right","[3,0]",".",",","%d/%m/%Y","%H:%M:%S","True","7"
diff --git a/odoo/addons/base/data/res_currency_data.xml b/odoo/addons/base/data/res_currency_data.xml
index 9966ae87ae6..f4028c0b698 100644
--- a/odoo/addons/base/data/res_currency_data.xml
+++ b/odoo/addons/base/data/res_currency_data.xml
@@ -670,8 +670,9 @@
<field name="symbol">RD$</field>
<field name="rounding">0.01</field>
<field name="active" eval="False"/>
- <field name="currency_unit_label">Peso</field>
+ <field name="currency_unit_label">Pesos</field>
<field name="currency_subunit_label">Centavos</field>
+ <field name="position">before</field>
</record>
<record id="ECS" model="res.currency">
diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py
index 627edf53c50..350b4d7a489 100644
--- a/odoo/addons/base/models/ir_module.py
+++ b/odoo/addons/base/models/ir_module.py
@@ -695,11 +695,10 @@ class Module(models.Model):
mod.write(updated_values)
else:
mod_path = modules.get_module_path(mod_name)
- if not mod_path:
+ if not mod_path or not terp:
continue
- if not terp or not terp.get('installable', True):
- continue
- mod = self.create(dict(name=mod_name, state='uninstalled', **values))
+ state = "uninstalled" if terp.get('installable', True) else "uninstallable"
+ mod = self.create(dict(name=mod_name, state=state, **values))
res[1] += 1
mod._update_dependencies(terp.get('depends', []))
diff --git a/odoo/addons/base/models/res_config.py b/odoo/addons/base/models/res_config.py
index 7712904fcc0..32beb3b5742 100644
--- a/odoo/addons/base/models/res_config.py
+++ b/odoo/addons/base/models/res_config.py
@@ -387,8 +387,6 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin)
def copy(self, values):
raise UserError(_("Cannot duplicate configuration!"), "")
- # TODO: Find replacement for 'onchange' attribute in view with dynamic
- # api.onchange(...) and migrate the onchange_module(...) accordingly.
@api.model
def fields_view_get(self, view_id=None, view_type='form',
toolbar=False, submenu=False):
@@ -410,9 +408,6 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin)
modifiers = json.loads(node.get("modifiers"))
modifiers['readonly'] = True
node.set("modifiers", json.dumps(modifiers))
- if 'on_change' not in node.attrib:
- node.set("on_change",
- "onchange_module(%s, '%s')" % (field, field))
ret_val['arch'] = etree.tostring(doc, encoding='unicode')
return ret_val
@@ -436,6 +431,16 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin)
}
return {}
+ def _register_hook(self):
+ """ Add an onchange method for each module field. """
+ def make_method(name):
+ return lambda self: self.onchange_module(self[name], name)
+
+ for name in self._fields:
+ if name.startswith('module_'):
+ method = make_method(name)
+ self._onchange_methods[name].append(method)
+
@api.model
def _get_classified_fields(self):
""" return a dictionary with the fields classified by category::
diff --git a/odoo/models.py b/odoo/models.py
index 087845db552..dae750654f5 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -2822,7 +2822,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
record._cache.update(record._convert_to_cache(values, validate=False))
if not self.env.cache.contains(self, field):
exc = AccessError("No value found for %s.%s" % (self, field.name))
- self.env.cache.set_failed(self, field, exc)
+ self.env.cache.set_failed(self, [field], exc)
@api.multi
def _read_from_database(self, field_names, inherited_field_names=[]):
diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py
index 28a9c1c170d..57d217e770d 100644
--- a/odoo/modules/migration.py
+++ b/odoo/modules/migration.py
@@ -56,8 +56,8 @@ class MigrationManager(object):
function. Theses files must respect a directory tree structure: A 'migrations' folder
which containt a folder by version. Version can be 'module' version or 'server.module'
version (in this case, the files will only be processed by this version of the server).
- Python file names must start by `pre` or `post` and will be executed, respectively,
- before and after the module initialisation. `end` scripts are run after all modules have
+ Python file names must start by `pre-` or `post-` and will be executed, respectively,
+ before and after the module initialisation. `end-` scripts are run after all modules have
been updated.
Example:
<moduledir>
diff --git a/odoo/tests/common.py b/odoo/tests/common.py
index bd1a4f0eda2..55fad1ceb73 100644
--- a/odoo/tests/common.py
+++ b/odoo/tests/common.py
@@ -530,7 +530,8 @@ class ChromeBrowser():
'--user-data-dir': self.user_data_dir,
'--disable-translate': '',
'--window-size': '1366x768',
- '--remote-debugging-port': str(self.devtools_port)
+ '--remote-debugging-port': str(self.devtools_port),
+ '--no-sandbox': '',
}
cmd = [self.executable]
cmd += ['%s=%s' % (k, v) if v else k for k, v in switches.items()]