[IMP]:hr:added kanban view for hr employess.

bzr revid: apa@tinyerp.com-20110916101214-hlff8uqv8y87h5bi
This commit is contained in:
Amit (OpenERP) 2011-09-16 15:42:14 +05:30
parent 92e1432757
commit dc1ba50c5e
3 changed files with 86 additions and 4 deletions

View File

@ -38,7 +38,7 @@ You can manage:
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/hr_department.jpeg', 'images/hr_employee.jpeg','images/hr_job_position.jpeg'],
'depends': ['base_setup', 'resource', 'board'],
'depends': ['base_setup','mail', 'resource', 'board'],
'init_xml': [],
'update_xml': [
'security/hr_security.xml',

View File

@ -149,7 +149,9 @@ class hr_employee(osv.osv):
'coach_id': fields.many2one('hr.employee', 'Coach'),
'job_id': fields.many2one('hr.job', 'Job'),
'photo': fields.binary('Photo'),
'passport_id':fields.char('Passport No', size=64)
'passport_id':fields.char('Passport No', size=64),
'color': fields.integer('Color Index'),
'city': fields.related('address_id', 'city', type='char', string='City'),
}
def unlink(self, cr, uid, ids, context=None):
@ -198,6 +200,7 @@ class hr_employee(osv.osv):
'active': 1,
'photo': _get_photo,
'marital': 'single',
'color': 0,
}
def _check_recursion(self, cr, uid, ids, context=None):

View File

@ -125,7 +125,72 @@
</search>
</field>
</record>
<!-- HR Kanban View -->
<record model="ir.ui.view" id="hr_kanban_view_employees">
<field name="name">HR - Employess Kanban</field>
<field name="model">hr.employee</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban default_group_by="department_id">
<field name="name"/>
<field name="color"/>
<field name="department_id"/>
<field name="job_id"/>
<field name="user_id"/>
<field name="photo"/>
<field name="city"/>
<templates>
<t t-name="kanban-box">
<t t-set="color" t-value="kanban_color(record.color.raw_value || record.name.raw_value)"/>
<div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')">
<div class="oe_kanban_box oe_kanban_color_border">
<div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle">
<table class="oe_kanban_table">
<tr>
<td class="oe_kanban_title1" align="left" valign="middle"><field name="name"/></td>
<td valign="top" width="22">
<img t-att-src="kanban_gravatar(record.user_id.value, 22)" class="oe_kanban_gravatar"/>
</td>
</tr>
</table>
</div>
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger oe_kanban_color_border">
<table class="oe_kanban_table">
<tr>
<td valign="top" width="40">
<img t-att-src="kanban_gravatar(record.photo.value, 40)" class="oe_kanban_gravatar"/>
</td>
<td>
<div class="oe_kanban_title2"><field name="job_id"/></div>
<div class="oe_kanban_title3">
<field name="department_id"/>
<t t-if="record.department_id.raw_value &amp;&amp; record.city.raw_value">,</t>
<field name="city"/>
</div>
<div class="oe_kanban_title3">
<i><field name="work_email"/>
<t t-if="record.work_phone.raw_value &amp;&amp; record.work_email.raw_value">,</t>
<field name="work_phone"/></i>
</div>
</td>
</tr>
</table>
</div>
<div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
<div class="oe_kanban_left">
<a string="Edit" icon="gtk-edit" type="edit"/>
<a string="Change Color" icon="color-picker" type="color" name="color"/>
<a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/>
</div>
<br class="oe_kanban_clear"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="open_view_employee_tree" model="ir.actions.act_window">
<field name="name">Employees Structure</field>
<field name="res_model">hr.employee</field>
@ -149,13 +214,27 @@
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,kanban</field>
<field name="domain">[]</field>
<field name="context">{"search_default_department_id": department_id,"search_default_active":eval('True')}</field>
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
<field name="help">Here you can manage your work force by creating employees and assigning them specific properties in the system. Maintain all employee related information and keep track of anything that needs to be recorded for them. The personal information tab will help you maintain their identity data. The Categories tab gives you the opportunity to assign them related employee categories depending on their position and activities within the company. A category can be a seniority level within the company or a department. The Timesheets tab allows to assign them a specific timesheet and analytic journal where they will be able to enter time through the system. In the note tab, you can enter text data that should be recorded for a specific employee.</field>
</record>
<record id="open_view_employee_list_my_tree2" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_employee_tree"/>
<field name="act_window_id" ref="open_view_employee_list_my"/>
</record>
<record id="open_view_employee_list_my_form2" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_employee_form"/>
<field name="act_window_id" ref="open_view_employee_list_my"/>
</record>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>