summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-06 13:54:22 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-06 13:54:22 +0200
commit7dc731db8308febb6426ee4c6d61b2a80d40c021 (patch)
tree3f181f2643e2030d3a81a4b4ff30fea2da9c5595 /addons
parent1e30b30a8fc08d539cb68fa214226501a3fb96d6 (diff)
parent1f16d34aaa722e5e8a035911501ae59480c6dd2e (diff)
[MERGE] forward port branch saas-15 up to 1f16d34aaa7
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/res_config.py7
-rw-r--r--addons/google_drive/models/google_drive.py2
-rw-r--r--addons/hr_timesheet/project_timesheet.py9
-rw-r--r--addons/mrp/wizard/change_production_qty.py2
-rw-r--r--addons/mrp/wizard/change_production_qty_views.xml1
-rw-r--r--addons/payment_authorize/views/payment_views.xml2
-rw-r--r--addons/web_editor/static/src/less/web_editor.ui.less7
-rw-r--r--addons/website/static/src/js/website.js5
-rw-r--r--addons/website_sale/controllers/main.py4
-rw-r--r--addons/website_sale/i18n/website_sale.pot4
-rw-r--r--addons/website_sale/views/templates.xml4
11 files changed, 38 insertions, 9 deletions
diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py
index 5f8f83826ef..eedcbe2b7a7 100644
--- a/addons/account/models/res_config.py
+++ b/addons/account/models/res_config.py
@@ -129,7 +129,12 @@ class AccountConfigSettings(models.TransientModel):
# related values, including the currency_id field on res_company. This in turn will trigger the recomputation
# of account_move_line related field company_currency_id which can be slow depending on the number of entries
# in the database. Thus, if we do not explicitely change the currency_id, we should not write it on the company
+ # Same for the field `code_digits` which will trigger a write on all the account.account to complete the
+ # code the missing characters to complete the desired number of digit, leading to a sql_constraint.
if ('company_id' in values and 'currency_id' in values):
- if self.env['res.company'].browse(values.get('company_id')).currency_id.id == values.get('currency_id'):
+ company = self.env['res.company'].browse(values.get('company_id'))
+ if company.currency_id.id == values.get('currency_id'):
values.pop('currency_id')
+ if company.accounts_code_digits == vals.get('code_digits'):
+ vals.pop('code_digits')
return super(AccountConfigSettings, self).create(values)
diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py
index b1eda64b842..f0e494c8405 100644
--- a/addons/google_drive/models/google_drive.py
+++ b/addons/google_drive/models/google_drive.py
@@ -160,7 +160,7 @@ class GoogleDrive(models.Model):
# check if a model is configured with a template
configs = self.search([('model_id', '=', res_model)])
config_values = []
- for config in configs:
+ for config in configs.sudo():
if config.filter_id:
if config.filter_id.user_id and config.filter_id.user_id.id != self.env.user.id:
#Private
diff --git a/addons/hr_timesheet/project_timesheet.py b/addons/hr_timesheet/project_timesheet.py
index 400d5aedc6f..8a50f3c1ef4 100644
--- a/addons/hr_timesheet/project_timesheet.py
+++ b/addons/hr_timesheet/project_timesheet.py
@@ -67,3 +67,12 @@ class Task(models.Model):
for task in self:
if task.parent_id and task.parent_id.project_id and task.project_id and task.project_id != task.parent_id.project_id.subtask_project_id:
raise UserError(_("You can't define a parent task if its project is not correctly configured. The sub-task's project of the parent task's project should be this task's project"))
+
+ @api.model
+ def create(self, vals):
+ context = dict(self.env.context)
+ # Remove default_parent_id to avoid a confusion in get_record_data
+ if context.get('default_parent_id', False):
+ vals['parent_id'] = context.pop('default_parent_id', None)
+ task = super(Task, self.with_context(context)).create(vals)
+ return task
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index eebf8d29962..463c30c0a7c 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -22,7 +22,7 @@ class ChangeProductionQty(models.TransientModel):
if 'mo_id' in fields and not res.get('mo_id') and self._context.get('active_model') == 'mrp.production' and self._context.get('active_id'):
res['mo_id'] = self._context['active_id']
if 'product_qty' in fields and not res.get('product_qty') and res.get('mo_id'):
- res['product_qty'] = self.env['mrp.production'].browse(res.get['mo_id']).product_qty
+ res['product_qty'] = self.env['mrp.production'].browse(res['mo_id']).product_qty
return res
@api.model
diff --git a/addons/mrp/wizard/change_production_qty_views.xml b/addons/mrp/wizard/change_production_qty_views.xml
index 0ba2fc8488e..f731d2cecc1 100644
--- a/addons/mrp/wizard/change_production_qty_views.xml
+++ b/addons/mrp/wizard/change_production_qty_views.xml
@@ -10,6 +10,7 @@
<form string="Change Product Qty">
<group>
<field name="product_qty"/>
+ <field name="mo_id" invisible="1"/>
</group>
<footer>
<button name="change_prod_qty" string="Approve"
diff --git a/addons/payment_authorize/views/payment_views.xml b/addons/payment_authorize/views/payment_views.xml
index 7c464bc24f4..7a957e41442 100644
--- a/addons/payment_authorize/views/payment_views.xml
+++ b/addons/payment_authorize/views/payment_views.xml
@@ -9,7 +9,7 @@
<group attrs="{'invisible': [('provider', '!=', 'authorize')]}">
<field name="authorize_login"/>
<field name="authorize_transaction_key" password="True"/>
- <a colspan="2" href="http://welcome.authorize.net/about_authorizenet/" target="_blank">How to configure your Authorize.Net account (look for Getting Started Guide) ?</a>
+ <a colspan="2" href="https://www.odoo.com/documentation/user/online/ecommerce/shopper_experience/authorize.html" target="_blank">How to get paid with Authorize.Net</a>
</group>
</xpath>
</field>
diff --git a/addons/web_editor/static/src/less/web_editor.ui.less b/addons/web_editor/static/src/less/web_editor.ui.less
index 4f1eb7dc4be..db1d6a8b2fe 100644
--- a/addons/web_editor/static/src/less/web_editor.ui.less
+++ b/addons/web_editor/static/src/less/web_editor.ui.less
@@ -1075,8 +1075,15 @@ body.editor_enable {
background-color: @odoo-brand-secondary;
#wrapwrap {
+ position: relative;
+ display: table;
+ table-layout: fixed;
+ width: 100%;
height: 100%;
+ > * {
+ display: table-row;
+ }
> main {
height: 100%;
diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js
index 72a5934fcd6..5ab4aca782c 100644
--- a/addons/website/static/src/js/website.js
+++ b/addons/website/static/src/js/website.js
@@ -7,6 +7,7 @@ odoo.define('website.website', function (require) {
var Widget = require('web.Widget');
var session = require('web.session');
var base = require('web_editor.base');
+ var utils = require('web.utils');
var qweb = core.qweb;
var _t = core._t;
@@ -238,6 +239,10 @@ odoo.define('website.website', function (require) {
}
});
+ /* Load localizations */
+ var lang = utils.get_cookie('website_lang') || $('html').attr('lang') || 'en_US';
+ ajax.loadJS('/web/webclient/locale/' + lang.replace('-', '_'));
+
/**
* Object who contains all method and bind for the top bar, the template is create server side.
*/
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index 8d97078b429..5d8a901bc3f 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -274,7 +274,9 @@ class WebsiteSale(http.Controller):
@http.route(['/shop/product/<model("product.template"):product>'], type='http', auth="public", website=True)
def product(self, product, category='', search='', **kwargs):
- product_context = dict(request.env.context, active_id=product.id)
+ product_context = dict(request.env.context,
+ active_id=product.id,
+ partner=request.env.user.partner_id)
ProductCategory = request.env['product.public.category']
Rating = request.env['rating.rating']
diff --git a/addons/website_sale/i18n/website_sale.pot b/addons/website_sale/i18n/website_sale.pot
index 1e1a4e53796..37b736949aa 100644
--- a/addons/website_sale/i18n/website_sale.pot
+++ b/addons/website_sale/i18n/website_sale.pot
@@ -1848,12 +1848,12 @@ msgstr ""
#. module: website_sale
#: model:ir.ui.view,arch_db:website_sale.sort
-msgid "Price <i class=\"fa fa-caret-down\" aria-hidden=\"true\"/>"
+msgid "Catalog price: decreasing order"
msgstr ""
#. module: website_sale
#: model:ir.ui.view,arch_db:website_sale.sort
-msgid "Price <i class=\"fa fa-caret-up\" aria-hidden=\"true\"/>"
+msgid "Catalog price: increasing order"
msgstr ""
#. module: website_sale
diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml
index dd46f3dee29..719072e2d9a 100644
--- a/addons/website_sale/views/templates.xml
+++ b/addons/website_sale/views/templates.xml
@@ -219,8 +219,8 @@
<template id="sort" inherit_id="website_sale.products" active="True" customize_show="True" name="Show Sort by">
<xpath expr="//div[@class='products_pager']/div/t[@t-call][last()]" position="after">
- <t t-set="list_price_desc_label">Price <i class="fa fa-caret-up" aria-hidden="true"/></t>
- <t t-set="list_price_asc_label">Price <i class="fa fa-caret-down" aria-hidden="true"/></t>
+ <t t-set="list_price_desc_label">Catalog price: decreasing order</t>
+ <t t-set="list_price_asc_label">Catalog price: increasing order</t>
<t t-set="name_asc_label">Name <i class="fa fa-caret-down" aria-hidden="true"/></t>
<t t-set="website_sale_sortable" t-value="[
(list_price_desc_label, 'list_price desc'),