[IMP] display alias on project, crm, hr

bzr revid: chm@openerp.com-20130304151355-g3asldjob722urc0
This commit is contained in:
Christophe Matthieu 2013-03-04 16:13:55 +01:00
parent 8cd3602a9f
commit 7515824c60
10 changed files with 30 additions and 38 deletions

View File

@ -14,9 +14,7 @@
'stage_type':'lead'
}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create an unqualified lead.
</p><p>
<p>
Use leads if you need a qualification step before creating an
opportunity or a customer. It can be a business card you received,
a contact form filled in your website, or a file of unqualified

View File

@ -15,9 +15,7 @@
'search_default_section_id': [active_id], 'default_section_id': active_id, 'default_type':'lead', 'stage_type':'lead'
}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new lead.
</p><p>
<p>
Use leads if you need a qualification step before creating an
opportunity or a customer. It can be a business card you received,
a contact form filled in your website, or a file of unqualified

View File

@ -478,6 +478,12 @@ class hr_applicant(base_stage, osv.Model):
"""
return self.set_priority(cr, uid, ids, '3')
def dynamic_help(self, cr, uid, help, context=None):
context['dynamic_help_model'] = 'hr.job'
context['dynamic_help_id'] = context.get('default_job_id', None)
context['dynamic_help_documents'] = _("job applicants")
return super(hr_applicant, self).dynamic_help(cr, uid, help, context=context)
class hr_job(osv.osv):
_inherit = "hr.job"

View File

@ -10,17 +10,13 @@
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new job applicant.
</p><p>
<p>
OpenERP helps you track applicants in the recruitment
process and follow up all operations: meetings, interviews, etc.
</p><p>
If you setup the email gateway, applicants and their attached
CV are created automatically when an email is sent to
jobs@yourcompany.com. If you install the document management
modules, all resumes are indexed automatically, so that you can
easily search through their content.
Applicants and their attached CV are created automatically when an email is sent.
If you install the document management modules, all resumes are indexed automatically,
so that you can easily search through their content.
</p>
</field>
</record>

View File

@ -307,12 +307,16 @@
attrs="{'invisible':[('survey_id','=',False)]}"/>
</div>
</field>
<xpath expr="//group//group" version="7.0" position="inside">
<field name="alias_id" invisible="1" required="0"/>
<label for="alias_name" attrs="{'invisible': [('alias_domain', '=', False)]}"/>
<div attrs="{'invisible': [('alias_domain', '=', False)]}">
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/>
</div>
<xpath expr="//sheet//group" version="7.0" position="after">
<group colspan="4">
<label for="alias_id"/>
<div class="oe_inline" attrs="{'invisible': [('alias_domain', '=', False)]}">
<field name="alias_id" class="oe_inline oe_read_only" required="0" nolabel="1"/>
<span class="oe_edit_only" name="edit_alias">
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field class="oe_inline" name="alias_domain"/>
</span>
</div>
</group>
</xpath>
</field>
</record>

View File

@ -98,7 +98,7 @@ class mail_thread(osv.AbstractModel):
alias = object_id.alias_id and object_id.alias_id.name_get() or False
if alias and alias[0] and alias[0][1]:
email = alias[0][1]
return "%s %s" % (help, _("<div class='oe_view_nocontent_create_alias'>You can also create %s by sending an email to: <b>%s</b></div>" % (context.get('dynamic_help_documents', _("documents")), email)))
return "%s %s" % (_("<p class='oe_view_nocontent_create'>Click to add a new %s or create this by sending an email to: <a href='mailto:%s'>%s</a></p>" % (context.get('dynamic_help_documents', _("documents")), email, email)), help)
else:
model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0]
alias_obj = self.pool.get('mail.alias')
@ -106,7 +106,7 @@ class mail_thread(osv.AbstractModel):
if alias_ids:
for alias in alias_obj.browse(cr, uid, alias_ids, context=context):
email = "%s@%s" % (alias.alias_name, alias.alias_domain)
return "%s %s" % (help, _("<div class='oe_view_nocontent_create_alias'>You can also create %s by sending an email. <br/>For example send an email to: <b>%s</b></div>" % (context.get('dynamic_help_documents', _("documents")), email)))
return "%s %s" % (_("<p class='oe_view_nocontent_create'>Click to add a new %s or create this by sending an email, for example to: <a href='mailto:%s'>%s</a></p>" % (context.get('dynamic_help_documents', _("documents")), email, email)), help)
return help
def _get_message_data(self, cr, uid, ids, name, args, context=None):

View File

@ -531,11 +531,11 @@ def Project():
context = dict(context, project_creation_in_progress=True)
mail_alias = self.pool.get('mail.alias')
if not vals.get('alias_id') and vals.get('name', False):
vals.pop('alias_name', None) # prevent errors during copy()
alias_name = vals.pop('alias_name', None) # prevent errors during copy()
alias_id = mail_alias.create_unique_alias(cr, uid,
# Using '+' allows using subaddressing for those who don't
# have a catchall domain setup.
{'alias_name': "project+"+short_name(vals['name'])},
{'alias_name': alias_name or "project+"+short_name(vals['name'])},
model_name=vals.get('alias_model', 'project.task'),
context=context)
vals['alias_id'] = alias_id

View File

@ -56,9 +56,7 @@
}</field>
<field name="search_view_id" ref="view_task_search_form"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new task.
</p><p>
<p>
OpenERP's project management allows you to manage the pipeline
of tasks in order to get things done efficiently. You can
track progress, discuss on tasks, attach documents, etc.
@ -114,7 +112,7 @@
</group>
<group colspan="4">
<label for="alias_id"/>
<div class="oe_inline" attrs="{'invisible': [('alias_domain', '=', False)]}">
<div class="oe_inline">
<field name="alias_id" class="oe_inline oe_read_only" required="0" nolabel="1"/>
<span class="oe_edit_only" name="edit_alias">
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field class="oe_inline" name="alias_domain"/>
@ -619,9 +617,7 @@
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
<field name="search_view_id" ref="view_task_search_form"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new task.
</p><p>
<p>
OpenERP's project management allows you to manage the pipeline
of tasks in order to get things done efficiently. You can
track progress, discuss on tasks, attach documents, etc.

View File

@ -1,7 +1,3 @@
.oe_list .oe_view_nocontent_create_alias {
padding-left: 78px;
}
.oe_kanban_project {
width: 220px;
min-height: 160px;

View File

@ -14,9 +14,7 @@
<field name="domain" eval=""/>
<field name="search_view_id" ref="view_project_issue_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to report a new issue.
</p><p>
<p>
The OpenERP issues tacker allows you to efficiantly manage things
like internal requests, software development bugs, customer
complaints, project troubles, material breakdowns, etc.