summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHardik <hsa@tinyerp.com>2012-07-06 19:36:16 +0530
committerHardik <hsa@tinyerp.com>2012-07-06 19:36:16 +0530
commitbb118fae427b05ab8c935d756aee5dafa14dec1b (patch)
tree2073351fe5053e0d6b973194fe1d0825c1cde85d
parent5babd88330af133b3bc893ed6e30b42eb2b7fa03 (diff)
[IMP]hr_holidays : view are improved
bzr revid: hsa@tinyerp.com-20120706140616-nylt94v652w9k2eg
-rw-r--r--addons/hr_holidays/hr_holidays.py3
-rw-r--r--addons/hr_holidays/hr_holidays_view.xml70
2 files changed, 29 insertions, 44 deletions
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index a1ab0ae04f3..84bdab4ad99 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -111,7 +111,7 @@ class hr_holidays(osv.osv):
return result
_columns = {
- 'name': fields.char('Description', required=True, size=64),
+ 'name': fields.text('Description'),
'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved')],
'State', readonly=True, help='The state is set to \'To Submit\', when a holiday request is created.\
\nThe state is \'To Approve\', when holiday request is confirmed by user.\
@@ -125,7 +125,6 @@ class hr_holidays(osv.osv):
#'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'),
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'),
- 'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
'number_of_days': fields.function(_compute_number_of_days, string='Number of Days', store=True),
'case_id': fields.many2one('crm.meeting', 'Meeting'),
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 1237cdb14f4..287ec8c83e6 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -112,39 +112,32 @@
<sheet string="Leave Request">
<group>
<group>
- <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
+ <field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
+ <label for="number_of_days_temp" string="Duration"/>
+ <group col="3">
+ <field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1" nolabel="1" class="oe_online"/>
+ <label string="-"/>
+ <field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1" nolabel="1" class="oe_online"/>
+ <div><field name="number_of_days_temp" nolabel="1" class="oe_inline"/> <label string="days" class="oe_inline"/></div>
+ </group>
+ </group>
+ <group>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
</group>
+ </group>
+ <group>
<group>
- <field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
- <label for="number_of_days_temp" string="Duration"/>
- <div>
- <field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/> -
- <field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/>
- <div>
- <field name="number_of_days_temp" class="oe_inline"/> days
- </div>
- </div>
+ <field name="double_validation" invisible="1"/>
+ </group>
+ <group>
+ <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}" groups="base.group_no_one"/>
</group>
</group>
- <notebook colspan="4">
- <page string="General">
- <group>
- <group>
- <field name="manager_id" groups="base.group_no_one"/>
- <field name="double_validation" invisible="1"/>
- </group>
- <group>
- <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}" groups="base.group_no_one"/>
- </group>
- </group>
- <newline/>
- <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
- </page>
- </notebook>
+ <newline/>
+ <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
</sheet>
<footer>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
@@ -171,27 +164,21 @@
<sheet>
<group>
<group>
- <field name="name"/>
+ <field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
+ <field name="number_of_days_temp"/>
+ </group>
+ <group>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Mode" groups="base.group_hr_manager"/>
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')], 'invisible':[('holiday_type','=','employee')]}"/>
<field name="department_id" attrs="{'readonly':['|', ('holiday_type','=','category'), ('state','not in' ,('draft', 'confirm'))]}"/>
</group>
- <group>
- <field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
- <field name="number_of_days_temp"/>
- </group>
</group>
- <notebook>
- <page string="General">
- <group col="4">
- <field name="double_validation" invisible="1"/>
- <field name="manager_id"/>
- <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}"/>
- </group>
- <field name="notes" placeholder="Add a reason..."/>
- </page>
- </notebook>
+ <group>
+ <field name="double_validation" invisible="1"/>
+ <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}"/>
+ </group>
+ <field name="name"/>
</sheet>
<footer>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
@@ -237,7 +224,6 @@
<field name="state"/>
</header>
<group col="4">
- <field name="name"/>
<field name="holiday_status_id"/>
<field name="type"/>
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
@@ -245,7 +231,7 @@
<field name="number_of_days_temp"/>
<field name="manager_id"/>
</group>
- <field name="notes"/>
+ <field name="name"/>
</form>
</field>
</record>