[MERGE] forward port branch saas-15 up to 3f6bb0f544

This commit is contained in:
Christophe Simonis
2017-05-02 18:53:44 +02:00
13 changed files with 69 additions and 24 deletions
@@ -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)
+2 -2
View File
@@ -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[
+8
View File
@@ -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.'))
+1 -1
View File
@@ -18,7 +18,7 @@
% set access_action = object.with_context(force_website=True).get_access_action()
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
% 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 '/mail/view?model=sale.order&res_id=%d' % (object.id) or ''
% if object.partner_id.parent_id:
+1 -1
View File
@@ -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)
+2 -1
View File
@@ -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'])
@@ -392,7 +392,7 @@ function parseInteger(value) {
value = value.replace(new RegExp(core._t.database.parameters.thousands_sep, "g"), '');
var parsed = Number(value);
// do not accept not numbers or float values
if (isNaN(parsed) || parsed % 1) {
if (isNaN(parsed) || parsed % 1 || parsed < -2147483648 || parsed > 2147483647) {
throw new Error(_.str.sprintf(core._t("'%s' is not a correct integer"), value));
}
return parsed;
+1 -1
View File
@@ -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[
@@ -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>
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_employee_public hr.employee.public hr.model_hr_employee base.group_public 1 0 0 0
3 access_hr_employee_portal hr.employee.portal hr.model_hr_employee base.group_portal 1 0 0 0
4 access_resource_public resource.resource.public resource.model_resource_resource base.group_public 1 0 0 0
5 access_resource_portal resource.resource.portal resource.model_resource_resource base.group_portal 1 0 0 0
+16
View File
@@ -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
+16 -10
View File
@@ -1440,16 +1440,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,
+8 -6
View File
@@ -77,12 +77,14 @@ def convert_column(cr, tablename, columnname, columntype):
log_exceptions=False)
except psycopg2.NotSupportedError:
# can't do inplace change -> use a casted temp column
query = 'ALTER TABLE "{0}" RENAME COLUMN "{1}" TO __temp_type_cast; ' \
'ALTER TABLE "{0}" ADD COLUMN "{1}" {2}; ' \
'UPDATE "{0}" SET "{1}"= __temp_type_cast::{2}' \
'ALTER TABLE "{0}" DROP COLUMN __temp_type_cast CASCADE'
cr.execute(query.format(tablename, columntype, columntype))
_schema.debug("Table %r: column %r changed to type %s", tablename, columntype, columntype)
query = '''
ALTER TABLE "{0}" RENAME COLUMN "{1}" TO __temp_type_cast;
ALTER TABLE "{0}" ADD COLUMN "{1}" {2};
UPDATE "{0}" SET "{1}"= __temp_type_cast::{2};
ALTER TABLE "{0}" DROP COLUMN __temp_type_cast CASCADE;
'''
cr.execute(query.format(tablename, columnname, columntype))
_schema.debug("Table %r: column %r changed to type %s", tablename, columnname, columntype)
def set_not_null(cr, tablename, columnname):
""" Add a NOT NULL constraint on the given column. """