summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-05-02 18:25:31 +0200
committerChristophe Simonis <chs@odoo.com>2017-05-02 18:25:31 +0200
commit3f6bb0f544d5bdd102eb06fbc7d5aa9095efc235 (patch)
tree3232782bf1bfdb788dd1bafdb11f1cff839f469d
parenteb19319585888988387b16cff7c7573b57b32a9b (diff)
parent6441ea28b3424b365a56b9a11953058b2a1593fc (diff)
[MERGE] forward port branch saas-14 up to 6441ea28b34
-rw-r--r--addons/account/wizard/account_financial_report.py2
-rw-r--r--addons/auth_signup/data/auth_signup_data.xml4
-rw-r--r--addons/hr_expense/models/hr_expense.py8
-rw-r--r--addons/sale/data/mail_template_data.xml2
-rw-r--r--addons/sale/models/account_invoice.py2
-rw-r--r--addons/stock/models/stock_warehouse.py3
-rw-r--r--addons/web/static/src/js/framework/formats.js2
-rw-r--r--addons/web_calendar/static/src/js/web_calendar.js8
-rw-r--r--addons/website_forum/data/forum_data.xml2
-rw-r--r--addons/website_hr/security/hr_employee_security.xml10
-rw-r--r--addons/website_hr/security/ir.model.access.csv2
-rw-r--r--addons/website_sale/i18n/en.po26
-rw-r--r--doc/cla/corporate/boolit.md16
-rw-r--r--odoo/addons/base/ir/ir_model.py26
14 files changed, 91 insertions, 22 deletions
diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py
index aca71bfc333..7712d1fa9cb 100644
--- a/addons/account/wizard/account_financial_report.py
+++ b/addons/account/wizard/account_financial_report.py
@@ -48,4 +48,4 @@ class AccountingReport(models.TransientModel):
def _print_report(self, data):
data['form'].update(self.read(['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter', 'target_move'])[0])
- return self.env['report'].get_action(self, 'account.report_financial', data=data)
+ return self.env['report'].get_action(self, 'account.report_financial', data=data, config=False)
diff --git a/addons/auth_signup/data/auth_signup_data.xml b/addons/auth_signup/data/auth_signup_data.xml
index 2cc3d07195c..2b6ceeeed79 100644
--- a/addons/auth_signup/data/auth_signup_data.xml
+++ b/addons/auth_signup/data/auth_signup_data.xml
@@ -20,7 +20,7 @@
<record id="reset_password_email" model="mail.template">
<field name="name">Auth Signup: Reset Password</field>
<field name="model_id" ref="base.model_res_users"/>
- <field name="email_from"><![CDATA[${object.company_id.name} <${(object.company_id.email or user.email)|safe}>]]></field>
+ <field name="email_from"><![CDATA["${object.company_id.name|safe}" <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_to">${object.email|safe}</field>
<field name="subject">Password reset</field>
<field name="body_html"><![CDATA[
@@ -56,7 +56,7 @@
<record id="set_password_email" model="mail.template">
<field name="name">Auth Signup: Odoo Connection</field>
<field name="model_id" ref="base.model_res_users"/>
- <field name="email_from"><![CDATA[${object.company_id.name} <${(object.company_id.email or user.email)|safe}>]]></field>
+ <field name="email_from"><![CDATA["${object.company_id.name|safe}" <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_to">${object.email|safe}</field>
<field name="subject"><![CDATA[${object.company_id.name} invitation to connect on Odoo]]></field>
<field name="body_html"><![CDATA[
diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py
index f3a10cfb417..facef9e2f6f 100644
--- a/addons/hr_expense/models/hr_expense.py
+++ b/addons/hr_expense/models/hr_expense.py
@@ -550,3 +550,11 @@ class HrExpenseSheet(models.Model):
res['domain'] = [('id', 'in', self.mapped('account_move_id').ids)]
res['context'] = {}
return res
+
+
+ @api.one
+ @api.constrains('expense_line_ids')
+ def _check_employee(self):
+ employee_ids = self.expense_line_ids.mapped('employee_id')
+ if len(employee_ids) > 1 or (len(employee_ids) == 1 and employee_ids != self.employee_id):
+ raise ValidationError(_('You cannot add expense lines of another employee.')) \ No newline at end of file
diff --git a/addons/sale/data/mail_template_data.xml b/addons/sale/data/mail_template_data.xml
index 5208b4698bf..9313fde20c1 100644
--- a/addons/sale/data/mail_template_data.xml
+++ b/addons/sale/data/mail_template_data.xml
@@ -18,7 +18,7 @@
% set access_action = object.with_context(force_website=True).get_access_action()
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
-% set access_name = is_online and object.template_id and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name
+% set access_name = is_online and object.template_id and doc_name == 'quotation' and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name
% set access_url = is_online and access_action['url'] or ''
% if object.partner_id.parent_id:
diff --git a/addons/sale/models/account_invoice.py b/addons/sale/models/account_invoice.py
index 713308aa7a1..815fa85c77d 100644
--- a/addons/sale/models/account_invoice.py
+++ b/addons/sale/models/account_invoice.py
@@ -101,4 +101,4 @@ class AccountInvoiceLine(models.Model):
layout_category_id = fields.Many2one('sale.layout_category', string='Section')
layout_category_sequence = fields.Integer(
related='layout_category_id.sequence',
- string='Layout Sequence', store=True, default=0)
+ string='Layout Sequence', store=True)
diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py
index 33362f927e1..95c128fd029 100644
--- a/addons/stock/models/stock_warehouse.py
+++ b/addons/stock/models/stock_warehouse.py
@@ -611,7 +611,8 @@ class Warehouse(models.Model):
pull.write({'name': pull.name.replace(warehouse.name, new_name, 1)})
for push in route.push_ids:
push.write({'name': push.name.replace(warehouse.name, new_name, 1)})
- warehouse.mto_pull_id.write({'name': warehouse.mto_pull_id.name.replace(warehouse.name, new_name, 1)})
+ if warehouse.mto_pull_id:
+ warehouse.mto_pull_id.write({'name': warehouse.mto_pull_id.name.replace(warehouse.name, new_name, 1)})
for warehouse in self:
sequence_data = warehouse._get_sequence_values()
warehouse.in_type_id.sequence_id.write(sequence_data['in_type_id'])
diff --git a/addons/web/static/src/js/framework/formats.js b/addons/web/static/src/js/framework/formats.js
index 479fa1082cd..c4d001a12e1 100644
--- a/addons/web/static/src/js/framework/formats.js
+++ b/addons/web/static/src/js/framework/formats.js
@@ -130,7 +130,7 @@ function parse_value (value, descriptor, value_if_empty) {
} while(tmp !== value);
tmp = Number(value);
// do not accept not numbers or float values
- if (isNaN(tmp) || tmp % 1)
+ if (isNaN(tmp) || tmp % 1 || tmp < -2147483648 || tmp > 2147483647)
throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
return tmp;
case 'monetary':
diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js
index f4995462698..39923af77b9 100644
--- a/addons/web_calendar/static/src/js/web_calendar.js
+++ b/addons/web_calendar/static/src/js/web_calendar.js
@@ -700,17 +700,17 @@ var CalendarView = View.extend({
date_start_day = new Date(event.start.getFullYear(),event.start.getMonth(),event.start.getDate(),7);
date_stop_day = new Date(event_end.getFullYear(),event_end.getMonth(),event_end.getDate(),19);
}
- data[this.date_start] = time.datetime_to_str(date_start_day);
+ data[this.date_start] = time.auto_date_to_str(date_start_day, this.fields[this.date_start].type);
if (this.date_stop) {
- data[this.date_stop] = time.datetime_to_str(date_stop_day);
+ data[this.date_stop] = time.auto_date_to_str(date_stop_day, this.fields[this.date_stop].type);
}
diff_seconds = Math.round((date_stop_day.getTime() - date_start_day.getTime()) / 1000);
}
else {
- data[this.date_start] = time.datetime_to_str(event.start);
+ data[this.date_start] = time.auto_date_to_str(event.start, this.fields[this.date_start].type);
if (this.date_stop) {
- data[this.date_stop] = time.datetime_to_str(event_end);
+ data[this.date_stop] = time.auto_date_to_str(event_end, this.fields[this.date_stop].type);
}
diff_seconds = Math.round((event_end.getTime() - event.start.getTime()) / 1000);
}
diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml
index b4a2a56ceba..939fac46191 100644
--- a/addons/website_forum/data/forum_data.xml
+++ b/addons/website_forum/data/forum_data.xml
@@ -138,7 +138,7 @@
<record id="validation_email" model="mail.template">
<field name="name">Forum: Email Verification</field>
<field name="model_id" ref="base.model_res_users"/>
- <field name="email_from"><![CDATA[${object.company_id.name} <${(object.company_id.email or user.email)|safe}>]]></field>
+ <field name="email_from"><![CDATA["${object.company_id.name|safe}" <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_to">${object.email|safe}</field>
<field name="subject"><![CDATA[${object.company_id.name} Forums validation]]></field>
<field name="body_html"><![CDATA[
diff --git a/addons/website_hr/security/hr_employee_security.xml b/addons/website_hr/security/hr_employee_security.xml
index e2125c2575b..a86b14310a8 100644
--- a/addons/website_hr/security/hr_employee_security.xml
+++ b/addons/website_hr/security/hr_employee_security.xml
@@ -10,4 +10,14 @@
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
+ <record id="hr_employee_portal" model="ir.rule">
+ <field name="name">hr_employee: Portal</field>
+ <field name="model_id" ref="hr.model_hr_employee"/>
+ <field name="domain_force">[('website_published', '=', True)]</field>
+ <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
+ <field name="perm_read" eval="True"/>
+ <field name="perm_write" eval="False"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_unlink" eval="False"/>
+ </record>
</odoo> \ No newline at end of file
diff --git a/addons/website_hr/security/ir.model.access.csv b/addons/website_hr/security/ir.model.access.csv
index 6f038a47ba9..53be505e42e 100644
--- a/addons/website_hr/security/ir.model.access.csv
+++ b/addons/website_hr/security/ir.model.access.csv
@@ -1,3 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_employee_public,hr.employee.public,hr.model_hr_employee,base.group_public,1,0,0,0
+access_hr_employee_portal,hr.employee.portal,hr.model_hr_employee,base.group_portal,1,0,0,0
access_resource_public,resource.resource.public,resource.model_resource_resource,base.group_public,1,0,0,0
+access_resource_portal,resource.resource.portal,resource.model_resource_resource,base.group_portal,1,0,0,0
diff --git a/addons/website_sale/i18n/en.po b/addons/website_sale/i18n/en.po
new file mode 100644
index 00000000000..0d18a095ad2
--- /dev/null
+++ b/addons/website_sale/i18n/en.po
@@ -0,0 +1,26 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_sale
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.saas~14\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-08 09:59+0000\n"
+"PO-Revision-Date: 2017-02-08 09:59+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: website_sale
+#: model:ir.ui.menu,name:website_sale.menu_orders_abandonned_orders
+msgid "Abandonned Orders"
+msgstr "Abandoned Orders"
+
+#. module: website_sale
+#: model:ir.actions.act_window,name:website_sale.action_abandonned_orders_ecommerce
+msgid "Abandonned eCommerce Orders"
+msgstr "Abandoned eCommerce Orders"
diff --git a/doc/cla/corporate/boolit.md b/doc/cla/corporate/boolit.md
new file mode 100644
index 00000000000..855d545d408
--- /dev/null
+++ b/doc/cla/corporate/boolit.md
@@ -0,0 +1,16 @@
+Lithuania, 2017-01-26
+
+Boolit JSC agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Andrius Laukavičius dev@boolit.eu https://github.com/oerp-odoo
+
+List of contributors:
+
+Dainius Kaniava dka@boolit.eu https://github.com/boolit-dka
+Andrius Laukavičius dev@boolit.eu https://github.com/oerp-odoo
diff --git a/odoo/addons/base/ir/ir_model.py b/odoo/addons/base/ir/ir_model.py
index 1c369d196bb..6de3c3c450c 100644
--- a/odoo/addons/base/ir/ir_model.py
+++ b/odoo/addons/base/ir/ir_model.py
@@ -1442,16 +1442,22 @@ class IrModelData(models.Model):
record = record.create(values)
if xml_id:
- for parent_model, parent_field in record._inherits.iteritems():
- if parent_model in existing_parents:
- continue
- self.sudo().create({
- 'name': xml_id + '_' + parent_model.replace('.', '_'),
- 'model': parent_model,
- 'module': module,
- 'res_id': record[parent_field].id,
- 'noupdate': noupdate,
- })
+ #To add an external identifiers to all inherits model
+ inherit_models = [record]
+ while inherit_models:
+ current_model = inherit_models.pop()
+ for parent_model_name, parent_field in current_model._inherits.iteritems():
+ inherit_models.append(self.env[parent_model_name])
+ if parent_model_name in existing_parents:
+ continue
+ self.sudo().create({
+ 'name': xml_id + '_' + parent_model_name.replace('.', '_'),
+ 'model': parent_model_name,
+ 'module': module,
+ 'res_id': record[parent_field].id,
+ 'noupdate': noupdate,
+ })
+ existing_parents.add(parent_model_name)
self.sudo().create({
'name': xml_id,
'model': model,