Pinakin Nayi (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-hr-attendance-pna into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-hr-attendance-pna/+merge/125641
Hello Sir,
I improved hr_attendance. Create group attendance to hide attendances fields
and menu (My Timesheet, Menu attendance, Button to sign in/sign out).
Thanks,
pna
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-hr-attendance-pna/+merge/125641
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-hr-attendance-pna.
=== modified file 'hr_attendance/__openerp__.py'
--- hr_attendance/__openerp__.py 2012-09-05 13:38:04 +0000
+++ hr_attendance/__openerp__.py 2012-09-21 07:15:23 +0000
@@ -35,11 +35,10 @@
'images': ['images/hr_attendances.jpeg'],
'depends': ['hr'],
'data': [
+ 'security/ir_rule.xml',
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_report.xml',
- 'security/ir.model.access.csv',
- 'security/ir_rule.xml',
'wizard/hr_attendance_bymonth_view.xml',
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
=== modified file 'hr_attendance/hr_attendance_view.xml'
--- hr_attendance/hr_attendance_view.xml 2012-09-07 13:55:38 +0000
+++ hr_attendance/hr_attendance_view.xml 2012-09-21 07:15:23 +0000
@@ -76,9 +76,9 @@
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="5" groups="base.group_user,base.group_hr_user,base.group_hr_manager"/>
- <menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="10" groups="base.group_user,base.group_hr_user,base.group_hr_manager"/>
+ <menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="10" groups="base.group_hr_user,base.group_hr_manager,base.group_hr_attendance"/>
- <menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="20"/>
+ <menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="20" groups="base.group_hr_attendance"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@@ -114,9 +114,8 @@
</record>
<menuitem
- sequence="35" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" name="Attendance"
- groups="base.group_no_one"/>
- <menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_new_config" groups="base.group_no_one"/>
+ sequence="35" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" groups="base.group_hr_attendance" name="Attendance"/>
+ <menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_new_config" groups="base.group_hr_attendance"/>
<record id="hr_attendance_employee" model="ir.ui.view">
<field name="name">hr.employee.form1</field>
@@ -124,8 +123,8 @@
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="active" position="before">
- <label for="state"/>
- <div>
+ <label for="state" groups="base.group_hr_attendance"/>
+ <div groups="base.group_hr_attendance">
<field name="state" class="oe_inline"/> -
<button class="oe_link" name="attendance_action_change" states="present" string="Sign Out" type="object" context="{'type':'sign_out'}" groups="base.group_hr_user"/>
<button class="oe_link" name="attendance_action_change" states="absent" string="Sign In" type="object" context="{'type':'sign_in'}" groups="base.group_hr_user"/>
=== modified file 'hr_attendance/security/ir_rule.xml'
--- hr_attendance/security/ir_rule.xml 2011-10-11 20:05:49 +0000
+++ hr_attendance/security/ir_rule.xml 2012-09-21 07:15:23 +0000
@@ -2,6 +2,12 @@
<openerp>
<data noupdate="True">
+ <record id="base.group_hr_attendance" model="res.groups">
+ <field name="name">Attendance</field>
+ <field name="category_id" ref="base.module_category_human_resources"/>
+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
+ </record>
+
<record id="property_rule_attendace_manager" model="ir.rule">
<field name="name">Manager Attendance</field>
<field model="ir.model" name="model_id" ref="model_hr_attendance"/>
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-09-10 04:30:39 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2012-09-21 07:15:23 +0000
@@ -333,7 +333,7 @@
'draft': [('readonly', False)],
'new': [('readonly', False)]}
),
- 'attendances_ids' : one2many_mod2('hr.attendance', 'sheet_id', 'Attendances'),
+ 'attendances_ids' : one2many_mod2('hr.attendance', 'sheet_id', 'Attendances',groups="base.group_attendance"),
'state' : fields.selection([
('new', 'New'),
('draft','Open'),
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet_data.xml'
--- hr_timesheet_sheet/hr_timesheet_sheet_data.xml 2012-08-30 14:18:52 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet_data.xml 2012-09-21 07:15:23 +0000
@@ -20,7 +20,7 @@
<field name="name">My Timesheet</field>
</record>
- <menuitem name="My Current Timesheet" id="menu_act_hr_timesheet_sheet_form_my_current" parent="hr_attendance.menu_hr_time_tracking" action="ir_actions_server_timsheet_sheet" sequence="1"/>
+ <menuitem name="My Current Timesheet" id="menu_act_hr_timesheet_sheet_form_my_current" parent="hr_attendance.menu_hr_time_tracking" action="ir_actions_server_timsheet_sheet" groups="base.group_hr_attendance" sequence="1"/>
</data>
</openerp>
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet_view.xml'
--- hr_timesheet_sheet/hr_timesheet_sheet_view.xml 2012-09-20 09:07:06 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet_view.xml 2012-09-21 07:15:23 +0000
@@ -64,7 +64,7 @@
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group>
- <field name="total_attendance" widget="float_time"/>
+ <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="user_id" invisible="1"/>
@@ -92,14 +92,14 @@
</tree>
</field>
<group>
- <div align="right" groups="base.group_hr_manager">
- <button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In"/>
- <button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out"/>
+ <div align="right" groups="base.group_hr_manager,base.group_hr_attendance">
+ <button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In" groups= "base.group_hr_attendance"/>
+ <button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out" groups= "base.group_hr_attendance"/>
</div>
</group>
</group>
<group col="4">
- <field name="state_attendance"/>
+ <field name="state_attendance" groups="base.group_hr_attendance"/>
</group>
<field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Lines">
@@ -134,7 +134,7 @@
<field colspan="4" name="period_ids" nolabel="1">
<tree colors="red:total_difference<0.1;blue:total_difference>=0.1" string="Period">
<field name="name"/>
- <field name="total_attendance" widget="float_time"/>
+ <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
</tree>
@@ -318,7 +318,7 @@
<field name="date_from"/>
<field name="date_to"/>
<field name="department_id"/>
- <field name="total_attendance" widget="float_time"/>
+ <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="state"/>
@@ -332,7 +332,7 @@
<field name="arch" type="xml">
<tree colors="blue:total_difference<0.1;red:total_difference>=0.1" string="Period">
<field name="name"/>
- <field name="total_attendance" widget="float_time" sum="Total Attendances"/>
+ <field name="total_attendance" widget="float_time" sum="Total Attendances" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time" sum="Total Timesheet"/>
<field name="total_difference" widget="float_time" sum="Total Difference"/>
</tree>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp