[IMP] introduce kanban view for the employees section and a dedicated css

bzr revid: abo@openerp.com-20120629172011-7p5u6nyni8lffobh
This commit is contained in:
Antonin Bourguignon 2012-06-29 19:20:11 +02:00
parent 8ea7e14b57
commit 05371d278a
3 changed files with 89 additions and 31 deletions

View File

@ -26,7 +26,7 @@
'category': 'Tools', 'category': 'Tools',
'complexity': "easy", 'complexity': "easy",
'description': """ 'description': """
This module adds crm menu and features (contact form) to your portal if crm and This module adds crm menu and features (contact form) to your portal if crm and
portal are installed. portal are installed.
""", """,
'author': 'OpenERP SA', 'author': 'OpenERP SA',
@ -38,6 +38,9 @@ portal are installed.
'installable': True, 'installable': True,
'auto_install':True, 'auto_install':True,
'category':'Hidden', 'category':'Hidden',
'css': [
'static/src/css/portal_crm.css',
],
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,12 @@
/* Main container */
.openerp .oe_portal_crm_contact {
width: 960px;
margin: 0 auto;
}
/* */
.openerp .oe_portal_crm_contact .oe_portal_crm_office .oe_fold_column.oe_kanban_record {
float: none;
display: block;
width: 100%;
}

View File

@ -8,23 +8,61 @@
<field name="model">portal_crm.crm_contact_us</field> <field name="model">portal_crm.crm_contact_us</field>
<field name="type">form</field> <field name="type">form</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Contact Us wizard view" version="7.0"> <form string="Contact wizard view" version="7.0">
<div style="width: 960px; margin: 0 auto;"> <div class="oe_portal_crm_contact">
<table> <table>
<tr> <tr>
<td width="80%%"> <td width="70%%">
<group> <h1>Get in touch</h1>
<field name="contact_name" string="Name"/> <group>
<field name="name" string="Company"/> <field name="contact_name" string="Name"/>
<field name="email_from"/> <field name="name" string="Company"/>
<field name="phone"/> <field name="email_from"/>
<field name="description" string="Your question"/> <field name="phone"/>
<label string=""/> <field name="description" string="Your question"/>
<button string="Submit" name="submit" type="object"/> <label string=""/>
</group> <button string="Submit" name="submit" type="object"/>
<field name="employee_ids"/> </group>
</td>
<td> <div class="oe_portal_crm_team">
<h1>Meet the team</h1>
<field name="employee_ids" widget="many2many_kanban">
<kanban>
<field name="last_login"/>
<templates>
<t t-name="kanban-box">
<div class="oe_employee_vignette">
<div class="oe_employee_image">
<a type="edit"><img t-att-src="kanban_image('hr.employee', 'photo', record.id.value)" class="oe_employee_picture"/></a>
</div>
<div class="oe_employee_details">
<h4><a type="edit"><field name="name"/> (<field name="login"/>)</a></h4>
<ul>
<li id="last_login">
<span t-if="record.last_login.raw_value &amp;&amp; record.last_login.raw_value.is().today()" class="oe_kanban_button" style="font-size: 100%%">
<t t-esc="record.last_login.raw_value.toString('HH:mm')"/>
</span>
</li>
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
<li t-if="record.work_location.raw_value"><field name="work_location"/></li>
<li t-if="record.work_phone.raw_value">Tel: <field name="work_phone"/></li>
<li t-if="record.mobile_phone.raw_value">Mobile: <field name="mobile_phone"/></li>
<li t-if="record.work_email.raw_value"><a t-attf-href="mailto:#{record.work_email.value}"><field name="work_email"/></a></li>
</ul>
</div>
</div>
<script>
$('.oe_employee_picture').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_employee_picture_wide') } });
</script>
</t>
</templates>
</kanban>
</field>
</div>
</td>
<td>
<div class="oe_portal_crm_office">
<h1>Our office</h1>
<field name="company_ids" widget="many2many_kanban"> <field name="company_ids" widget="many2many_kanban">
<kanban> <kanban>
<field name="name"/> <field name="name"/>
@ -38,20 +76,24 @@
<field name="state_id"/> <field name="state_id"/>
<templates> <templates>
<t t-name="kanban-box"> <t t-name="kanban-box">
<div style="position: relative"> <!-- <img t-att-src="kanban_image('res.partner', 'photo', record.id.value)" class="oe_avatar oe_kanban_avatar_toto"/> -->
<h4><field name="name"/></h4>
<!-- <img t-att-src="kanban_image('res.partner', 'photo', record.id.value)" class="oe_avatar oe_kanban_avatar_toto"/> --> <field name="street"/><br/>
<h4><field name="name"/></h4> <field name="street2"/><br/>
<a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value" style="text-decoration: none;" > <field name="zip"/>
<field name="email"/> <field name="city"/><br/>
</a> <field name="country_id"/><br/>
</div> <br/>
<a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value">
<field name="email"/>
</a>
</t> </t>
</templates> </templates>
</kanban> </kanban>
</field> </field>
</td> </div>
</tr> </td>
</tr>
</table> </table>
</div> </div>
</form> </form>
@ -67,9 +109,9 @@
<field name="priority">99</field> <field name="priority">99</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Thank you"> <form string="Thank you">
<!-- <!--
make sure there is at least one field in the view, make sure there is at least one field in the view,
otherwise the orm will try to select all the model's otherwise the orm will try to select all the model's
records and this will result in a permission denied error records and this will result in a permission denied error
--> -->
<field name="name" invisible="1"/> <field name="name" invisible="1"/>
@ -80,9 +122,10 @@
<!-- wizard action --> <!-- wizard action -->
<record id="action_wizard_contact_us" model="ir.actions.act_window"> <record id="action_wizard_contact_us" model="ir.actions.act_window">
<field name="name">Contact Us</field> <field name="name">Contact</field>
<field name="res_model">portal_crm.crm_contact_us</field> <field name="res_model">portal_crm.crm_contact_us</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">inline</field>
</record> </record>
<!-- attach it to the portal menu --> <!-- attach it to the portal menu -->