summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-23 18:02:45 +0200
committerChristophe Simonis <chs@odoo.com>2018-10-23 18:02:45 +0200
commitce2eb8464b4387e98cd3b1081340cdebb586f2b3 (patch)
tree416031da80cbd85804f2b1ff48ccd6f763dab3b3
parentef670016e6df436e30fef12d1915c6cec2b9d62a (diff)
parentd5cc05c9948c744f8f011250380cea20f9f859b2 (diff)
[MERGE] forward port branch 10.0 up to d5cc05c9948
-rw-r--r--addons/account/i18n/account.pot5
-rw-r--r--addons/account/models/account.py2
-rw-r--r--addons/point_of_sale/static/src/js/screens.js6
-rw-r--r--addons/web_editor/static/src/js/rte.js8
-rw-r--r--addons/website_sale/controllers/main.py6
-rw-r--r--doc/_extensions/github_link.py9
-rw-r--r--doc/_extensions/odoo_ext/__init__.py11
-rw-r--r--doc/howtos/backend/exercise-report8
-rw-r--r--doc/reference/orm.rst6
9 files changed, 43 insertions, 18 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot
index cf6c74c5edf..87fc90452e3 100644
--- a/addons/account/i18n/account.pot
+++ b/addons/account/i18n/account.pot
@@ -9987,3 +9987,8 @@ msgstr ""
msgid "→ Count"
msgstr ""
+#. module: account
+#: code:addons/account/models/account.py:309
+#, python-format
+msgid "Currency field should only be set if the journal's currency is different from the company's. Leave the field blank to use company currency."
+msgstr ""
diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index 5c98487b3fe..2bd54e3c8f9 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -262,6 +262,8 @@ class AccountJournal(models.Model):
@api.constrains('currency_id', 'default_credit_account_id', 'default_debit_account_id')
def _check_currency(self):
if self.currency_id:
+ if self.currency_id == self.company_id.currency_id:
+ raise ValidationError(_("Currency field should only be set if the journal's currency is different from the company's. Leave the field blank to use company currency."))
if self.default_credit_account_id and not self.default_credit_account_id.currency_id.id == self.currency_id.id:
raise ValidationError(_('Configuration error!\nThe currency of the journal should be the same than the default credit account.'))
if self.default_debit_account_id and not self.default_debit_account_id.currency_id.id == self.currency_id.id:
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index b37dc13ff95..8b1b001c340 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -1224,6 +1224,9 @@ var ClientListScreenWidget = ScreenWidget.extend({
fields.id = partner.id || false;
fields.country_id = fields.country_id || false;
+ var contents = this.$(".client-details-contents");
+ contents.off("click", ".button.save");
+
new Model('res.partner').call('create_from_ui',[fields]).then(function(partner_id){
self.saved_client_details(partner_id);
},function(err,event){
@@ -1237,6 +1240,7 @@ var ClientListScreenWidget = ScreenWidget.extend({
'title': _t('Error: Could not Save Changes'),
'body': error_body,
});
+ contents.on('click','.button.save',function(){ self.save_client_details(partner); });
});
},
@@ -1254,6 +1258,8 @@ var ClientListScreenWidget = ScreenWidget.extend({
// has created, and reload_partner() must have loaded the newly created partner.
self.display_client_details('hide');
}
+ }).always(function(){
+ $(".client-details-contents").on('click','.button.save',function(){ self.save_client_details(partner); });
});
},
diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js
index da2c2acd5e0..940d8482341 100644
--- a/addons/web_editor/static/src/js/rte.js
+++ b/addons/web_editor/static/src/js/rte.js
@@ -518,6 +518,14 @@ var RTE = Widget.extend({
return;
}
+ // Removes strange _moz_abspos attribute when it appears. Cannot
+ // find another solution which works in all cases. A grabber still
+ // appears at the same time which I did not manage to remove.
+ // TODO find a complete and better solution
+ _.defer(function () {
+ $editable.find('[_moz_abspos]').removeAttr('_moz_abspos');
+ });
+
if ($target.is('a')) {
/**
* Remove content editable everywhere and add it on the link only so that characters can be added
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index 990ad81d476..829d1372f54 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -368,7 +368,11 @@ class WebsiteSale(http.Controller):
@http.route(['/shop/cart/update'], type='http', auth="public", methods=['POST'], website=True, csrf=False)
def cart_update(self, product_id, add_qty=1, set_qty=0, **kw):
- request.website.sale_get_order(force_create=1)._cart_update(
+ sale_order = request.website.sale_get_order(force_create=1)
+ if sale_order.state != 'draft':
+ request.session['sale_order_id'] = None
+ sale_order = request.website.sale_get_order(force_create=True)
+ sale_order._cart_update(
product_id=int(product_id),
add_qty=add_qty,
set_qty=set_qty,
diff --git a/doc/_extensions/github_link.py b/doc/_extensions/github_link.py
index cd0c5380621..b09177cf6e2 100644
--- a/doc/_extensions/github_link.py
+++ b/doc/_extensions/github_link.py
@@ -94,11 +94,12 @@ def add_doc_link(app, pagename, templatename, context, doctree):
if not app.config.github_user and app.config.github_project:
return
- # FIXME: find other way to recover current document's source suffix
- # in Sphinx 1.3 it's possible to have mutliple source suffixes and that
- # may be useful in the future
source_suffix = app.config.source_suffix
- source_suffix = source_suffix if isinstance(source_suffix, basestring) else source_suffix[0]
+ # in 1.3 source_suffix can be a list
+ # in 1.8 source_suffix can be a mapping
+ # FIXME: will break if we ever add support for !rst markdown documents maybe
+ if not isinstance(source_suffix, basestring):
+ source_suffix = next(iter(source_suffix))
# can't use functools.partial because 3rd positional is line not mode
context['github_link'] = lambda mode='edit': make_github_link(
app, 'doc/%s%s' % (pagename, source_suffix), mode=mode)
diff --git a/doc/_extensions/odoo_ext/__init__.py b/doc/_extensions/odoo_ext/__init__.py
index 0ec55620497..c1637623e62 100644
--- a/doc/_extensions/odoo_ext/__init__.py
+++ b/doc/_extensions/odoo_ext/__init__.py
@@ -8,10 +8,13 @@ import sphinx.environment
import sphinx.builders.html
from docutils import nodes
def setup(app):
- if getattr(app.config, 'html_translator_class', None):
- app.warn("Overriding the explicitly set html_translator_class setting",
- location="odoo extension")
- app.config.html_translator_class = 'odoo_ext.translator.BootstrapTranslator'
+ if hasattr(app, 'set_translator'):
+ app.set_translator('html', translator.BootstrapTranslator)
+ else:
+ if getattr(app.config, 'html_translator_class', None):
+ app.warn("Overriding the explicitly set html_translator_class setting",
+ location="odoo extension")
+ app.config.html_translator_class = 'odoo_ext.translator.BootstrapTranslator'
switcher.setup(app)
app.add_config_value('odoo_cover_default', None, 'env')
diff --git a/doc/howtos/backend/exercise-report b/doc/howtos/backend/exercise-report
index 08ac677b5c0..00304254583 100644
--- a/doc/howtos/backend/exercise-report
+++ b/doc/howtos/backend/exercise-report
@@ -3,8 +3,8 @@
Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:21.535783052 +0200
-+++ addons/openacademy/__manifest__.py 2014-08-26 17:26:21.531783052 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200
++++ addons/openacademy/__manifest__.py 2014-08-29 08:39:52.000000000 +0200
@@ -21,7 +21,7 @@
'version': '0.1',
@@ -14,10 +14,6 @@ Index: addons/openacademy/__manifest__.py
# always loaded
'data': [
-Index: addons/openacademy/__manifest__.py
-===================================================================
---- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200
-+++ addons/openacademy/__manifest__.py 2014-08-29 08:39:52.000000000 +0200
@@ -30,6 +30,7 @@
'templates.xml',
'views/openacademy.xml',
diff --git a/doc/reference/orm.rst b/doc/reference/orm.rst
index bec009411b7..a8a95895b01 100644
--- a/doc/reference/orm.rst
+++ b/doc/reference/orm.rst
@@ -942,17 +942,17 @@ them (e.g. to change their default sort order):
.. literalinclude:: ../../odoo/addons/test_documentation_examples/extension.py
:language: python
- :lines: 5-
+ :lines: 7-
.. literalinclude:: ../../odoo/addons/test_documentation_examples/tests/test_extension.py
:language: python
- :lines: 8,13
+ :lines: 10,15
will yield:
.. literalinclude:: ../../odoo/addons/test_documentation_examples/tests/test_extension.py
:language: text
- :lines: 11
+ :lines: 13
.. note:: it will also yield the various :ref:`automatic fields
<reference/orm/model/automatic>` unless they've been disabled