Avoid privacy issues

This commit is contained in:
Alexis de Lattre
2016-05-11 18:42:52 +02:00
parent 02940c08cd
commit 6e8e9fa1aa
3 changed files with 31 additions and 23 deletions

View File

@@ -225,6 +225,11 @@ class HrHolidays(models.Model):
posted_date = fields.Date( posted_date = fields.Date(
string='Posted Date', track_visibility='onchange') string='Posted Date', track_visibility='onchange')
number_of_days_temp = fields.Float(string="Number of days") number_of_days_temp = fields.Float(string="Number of days")
# The 'name' field is displayed publicly in the calendar
# So the label should not be 'Description' but 'Public Title'
name = fields.Char(
string='Public Title', help="Warning: this title is shown publicly in the "
"calendar. Don't write private/personnal information in this field.")
@api.one @api.one
@api.constrains( @api.constrains(

View File

@@ -89,10 +89,8 @@ if not object.no_email_notification:
% endif % endif
<li>Number of days : ${object.number_of_days < 0 and object.number_of_days * -1 or object.number_of_days}</li> <li>Number of days : ${object.number_of_days < 0 and object.number_of_days * -1 or object.number_of_days}</li>
<li>Leave type : ${object.holiday_status_id.name or ''}</li> <li>Leave type : ${object.holiday_status_id.name or ''}</li>
<li>Description : ${object.name or ''}</li> <li>Public title : ${object.name or ''}</li>
% if object.notes: <li>Notes for the manager : ${object.notes or ''}</li>
<li>Notes : ${object.notes or ''}</li>
% endif
</ul> </ul>
% if ctx.get('wkf_tracker') == 'submitted': % if ctx.get('wkf_tracker') == 'submitted':

View File

@@ -35,26 +35,31 @@ hr_holidays.edit_holiday_new is used for both leaves and allocation -->
<field name="vacation_date_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/> <field name="vacation_date_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
<field name="vacation_time_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/> <field name="vacation_time_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
</field> </field>
<xpath expr="//field[@name='department_id']/.." position="after"> <field name="notes" position="replace">
<group string="Counter for this leave type" name="counters" attrs="{'invisible': [('limit', '=', True)]}"> <group name="bottom">
<field name="limit" invisible="1"/> <group string="Message for the Manager" name="notes">
<label for="total_allocated_leaves"/> <field name="notes" nolabel="1" placeholder="Add a message for your manager..."/>
<div> </group>
<field name="total_allocated_leaves" class="oe_inline"/> <group string="Counter for this leave type" name="counters" attrs="{'invisible': [('limit', '=', True)]}">
<label string=" days" class="oe_inline"/> <field name="limit" invisible="1"/>
</div> <label for="total_allocated_leaves"/>
<label for="current_leaves_taken"/> <div>
<div> <field name="total_allocated_leaves" class="oe_inline"/>
<field name="current_leaves_taken" class="oe_inline"/> <label string=" days" class="oe_inline"/>
<label string=" days" class="oe_inline"/> </div>
</div> <label for="current_leaves_taken"/>
<label for="current_remaining_leaves"/> <div>
<div> <field name="current_leaves_taken" class="oe_inline"/>
<field name="current_remaining_leaves" class="oe_inline"/> <label string=" days" class="oe_inline"/>
<label string=" days" class="oe_inline"/> </div>
</div> <label for="current_remaining_leaves"/>
<div>
<field name="current_remaining_leaves" class="oe_inline"/>
<label string=" days" class="oe_inline"/>
</div>
</group>
</group> </group>
</xpath> </field>
<field name="department_id" position="after"> <field name="department_id" position="after">
<field name="posted_date" groups="base.group_hr_manager"/> <field name="posted_date" groups="base.group_hr_manager"/>
</field> </field>