[MERGE] forward port branch saas-15 up to bff43f0aa1

This commit is contained in:
Christophe Simonis
2018-10-24 16:14:52 +02:00
7 changed files with 29 additions and 5 deletions
+5
View File
@@ -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 ""
+2
View File
@@ -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:
@@ -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">
@@ -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); });
});
},
@@ -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
+5 -1
View File
@@ -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,
+3 -3
View File
@@ -947,17 +947,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