diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-10-24 16:14:52 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-10-24 16:14:52 +0200 |
| commit | 58525e29d87b4a7d334dc07db52eba9af5ca8cdf (patch) | |
| tree | a319191e9f04ca6f575a3431502d99422f6f085d /addons | |
| parent | 7c45f22ceac8246f627f62ed38df020b96d9a0a6 (diff) | |
| parent | bff43f0aa14aa6537d44a54419221e05d5ae7131 (diff) | |
[MERGE] forward port branch saas-15 up to bff43f0aa14
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/i18n/account.pot | 5 | ||||
| -rw-r--r-- | addons/account/models/account.py | 2 | ||||
| -rw-r--r-- | addons/account/test/account_minimal_test.xml | 1 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/js/screens.js | 6 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/rte.js | 8 | ||||
| -rw-r--r-- | addons/website_sale/controllers/main.py | 6 |
6 files changed, 26 insertions, 2 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 26eb3b066e2..d16e22a5f51 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -10927,3 +10927,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 800e52e7539..95c55b6c0f3 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -447,6 +447,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/account/test/account_minimal_test.xml b/addons/account/test/account_minimal_test.xml index e127af9b289..5e1753efbfc 100644 --- a/addons/account/test/account_minimal_test.xml +++ b/addons/account/test/account_minimal_test.xml @@ -284,7 +284,6 @@ <field name="type">bank</field> <field name="default_debit_account_id" ref="usd_bnk"/> <field name="default_credit_account_id" ref="usd_bnk"/> - <field name="currency_id" ref="base.USD"/> <field name="bank_account_id" ref="bank_account_usd"/> </record> <record id="base.main_company" model="res.company"> diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 75030e95acc..63aff0fc7ef 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1278,6 +1278,9 @@ var ClientListScreenWidget = ScreenWidget.extend({ } else { fields.property_product_pricelist = false; } + var contents = this.$(".client-details-contents"); + contents.off("click", ".button.save"); + rpc.query({ model: 'res.partner', @@ -1297,6 +1300,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); }); }); }, @@ -1314,6 +1318,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/editor/rte.js b/addons/web_editor/static/src/js/editor/rte.js index 341b42f93c6..90062a02b02 100644 --- a/addons/web_editor/static/src/js/editor/rte.js +++ b/addons/web_editor/static/src/js/editor/rte.js @@ -591,6 +591,14 @@ var RTEWidget = 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 d0eab8fa087..452d5507c3e 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -398,7 +398,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, |
