code improved and merge with trunk

bzr revid: tta@openerp.com-20120427133241-8c5ian8e7p4bb642
This commit is contained in:
Tejas Tank 2012-04-27 19:02:41 +05:30
commit 9cce3c670a
5 changed files with 21 additions and 19 deletions

View File

@ -81,7 +81,7 @@
<field colspan="4" name="line_ids" nolabel="1" context="{'currency_id': currency_id}">
<form string="Expense Lines">
<group col="6" colspan="4">
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)"/>
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" context="{'default_hr_expense_ok':1}"/>
<field name="name" colspan="4"/>
<newline/>
<field name="unit_amount"/>

View File

@ -351,7 +351,7 @@ class hr_holidays(osv.osv):
if record.employee_id and not record.holiday_status_id.limit:
leaves_rest = holi_status_obj.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < record.number_of_days_temp:
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
raise osv.except_osv(_('Warning!'), _('There are not enough %s allocated for employee %s; please create an allocation request for this leave type.') % (record.holiday_status_id.name, record.employee_id.name))
return True
# -----------------------------

View File

@ -66,25 +66,25 @@
<form string="Leave Request">
<group col="8" colspan="4">
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_manager"/>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
<group attrs="{'invisible':[('holiday_type','=','category')]}">
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}" groups="base.group_hr_user"/>
</group>
</group>
<notebook colspan="4">
<page string="General">
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}"/>
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
<field name="number_of_days_temp"/>
<field name="double_validation" invisible="1"/>
<newline/>
<field name="manager_id"/>
<field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}"/>
<field name="manager_id" groups="base.group_no_one"/>
<field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}" groups="base.group_no_one"/>
<separator string="Reasons" colspan="4"/>
<field name="notes" nolabel="1" colspan="4"/>
<group colspan="4" col="8">
@ -152,8 +152,8 @@
<field name="arch" type="xml">
<tree fonts="bold:needaction_pending==True" colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
<field name="needaction_pending" invisible="1"/>
<field name="holiday_type"/>
<field name="employee_id"/>
<field name="holiday_type"/>
<field name="category_id"/>
<field name="department_id" invisible="1"/>
<field name="holiday_status_id"/>
@ -235,21 +235,21 @@
<field name="arch" type="xml">
<tree fonts="bold:needaction_pending==True" colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
<field name="needaction_pending" invisible="1"/>
<field name="holiday_type"/>
<field name="employee_id"/>
<field name="category_id"/>
<field name="department_id" invisible="not context.get('set_visible',False)"/>
<field name="holiday_status_id"/>
<field name="holiday_type" string="Mode" groups="base.group_hr_user"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="state"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="not context.get('set_visible',False)"/>
<field name="holiday_status_id" invisible="1"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<!--field name="type"/-->
<field name="state"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
</tree>
</field>
</record>

View File

@ -64,7 +64,7 @@
<field name="user_id"/>
<field name="state"/>
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
<button name="case_pending" string="Pending" states="open" type="object" icon="gtk-media-pause"/>
</tree>
</field>
</record>
@ -319,8 +319,10 @@
<a t-if="record.survey.raw_value" name="action_print_survey" type="object" string="Print Interview" icon="gtk-print" />
</div>
<div class="oe_kanban_right">
<a name="case_cancel" string="Refuse" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<a name="case_open" string="In Progress" states="draft,pending" type="object" icon="kanban-apply"/>
<a name="case_pending" string="Pending" states="draft,open" type="object" icon="kanban-pause"/>
<a name="case_pending" string="Pending" states="open" type="object" icon="kanban-pause"/>
<a name="%(action_hr_recruitment_hired_employee)d" string="Hire" states="open,pending" type="action" icon="terp-partner"/>
</div>
<br class="oe_kanban_clear"/>
</div>

View File

@ -21,7 +21,7 @@ Lets the company customize which Pad installation should be used to link to new
'auto_install': False,
'web': True,
'certificate' : '001183545978470526509',
'js': 'static/src/js/*.js',
'js': ['static/src/js/pad.js'],
'qweb' : [
"static/src/xml/*.xml",
],