Merge branch 'master' into master-pos-small-imps-of-july-fva

This commit is contained in:
Frederic van der Essen
2014-07-25 14:31:39 +02:00
4 changed files with 21 additions and 2 deletions
+5 -1
View File
@@ -531,7 +531,11 @@ def Project():
project_id = super(project, self).create(cr, uid, vals, context=create_context)
project_rec = self.browse(cr, uid, project_id, context=context)
self.pool.get('mail.alias').write(cr, uid, [project_rec.alias_id.id], {'alias_parent_thread_id': project_id, 'alias_defaults': {'project_id': project_id}}, context)
ir_values = self.pool.get('ir.values').get_default( cr, uid, 'project.config.settings', 'generate_project_alias' )
values = { 'alias_parent_thread_id': project_id, 'alias_defaults': {'project_id': project_id}}
if ir_values:
values = dict(values, alias_name=vals['name'])
self.pool.get('mail.alias').write(cr, uid, [project_rec.alias_id.id], values, context=context)
return project_id
def write(self, cr, uid, ids, vals, context=None):
+6
View File
@@ -58,6 +58,8 @@ class project_configuration(osv.osv_memory):
'group_manage_delegation_task': fields.boolean("Allow task delegation",
implied_group='project.group_delegate_task',
help="Allows you to delegate tasks to other users."),
'generate_project_alias': fields.boolean("Automatically generate an email alias at the project creation",
help="Odoo will generate an email alias at the project creation from project name."),
}
def get_default_time_unit(self, cr, uid, fields, context=None):
@@ -74,4 +76,8 @@ class project_configuration(osv.osv_memory):
return {'value': {'group_tasks_work_on_tasks': True}}
return {}
def set_default_generate_project_alias(self, cr, uid, ids, context=None):
config_value = self.browse(cr, uid, ids, context=context).generate_project_alias
self.pool.get('ir.values').set_default(cr, uid, 'project.config.settings', 'generate_project_alias', config_value)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+9
View File
@@ -63,6 +63,15 @@
</div>
</div>
</group>
<group>
<label for="id" string="Communication"/>
<div>
<div>
<field name="generate_project_alias" class="oe_inline"/>
<label for="generate_project_alias" />
</div>
</div>
</group>
<separator string="Helpdesk &amp; Support"/>
<group>
<label for="id" string="Support"/>
+1 -1
View File
@@ -887,7 +887,7 @@ class Contact(orm.AbstractModel):
val = {
'name': value.split("\n")[0],
'address': escape("\n".join(value.split("\n")[1:])),
'address': escape("\n".join(value.split("\n")[1:])).strip(),
'phone': field_browse.phone,
'mobile': field_browse.mobile,
'fax': field_browse.fax,