[IMP]: set reqd=False on 'name' field and improved view

bzr revid: mtr@tinyerp.com-20120801124044-1asum92rkjnipnms
This commit is contained in:
Meera Trambadia 2012-08-01 18:10:44 +05:30
parent dbcd304455
commit 0b6e36ef48
2 changed files with 11 additions and 4 deletions

View File

@ -113,7 +113,7 @@ class hr_holidays(osv.osv):
return result
_columns = {
'name': fields.char('Description', required=True, size=64),
'name': fields.char('Description', size=64),
'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.\

View File

@ -110,6 +110,10 @@
</header>
<sheet string="Leave Request">
<group>
<group col="3">
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
</group>
<newline></newline>
<group>
<field name="holiday_status_id" on_change="onchange_status_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
<label for="number_of_days_temp" string="Duration"/>
@ -139,8 +143,6 @@
<field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}" groups="base.group_no_one"/>
</group>
</group>
<newline/>
<field name="name" nolabel="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}" placeholder="Add a reason..."/>
</group>
</sheet>
<div class="oe_chatter">
@ -166,6 +168,10 @@
</header>
<sheet>
<group>
<group>
<field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
</group>
<newline/>
<group>
<field name="holiday_status_id" on_change="onchange_status_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
<field name="number_of_days_temp"/>
@ -181,7 +187,8 @@
<field name="double_validation" invisible="1"/>
<field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}"/>
</group>
<field name="name" placeholder="Add a reason..."/>
<newline/>
<field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>