Rémy Taymans
5 years ago
14 changed files with 100 additions and 148 deletions
-
61beesdoo_shift/models/res_config_settings.py
-
1beesdoo_shift/security/group.xml
-
9beesdoo_shift_attendance/__manifest__.py
-
3beesdoo_shift_attendance/data/mail_template.xml
-
12beesdoo_shift_attendance/data/system_parameter.xml
-
55beesdoo_shift_attendance/demo/users.xml
-
22beesdoo_shift_attendance/models/attendance_sheet.py
-
22beesdoo_shift_attendance/models/res_config_settings.py
-
21beesdoo_shift_attendance/security/group.xml
-
12beesdoo_shift_attendance/security/ir.model.access.csv
-
20beesdoo_shift_attendance/tests/test_beesdoo_shift.py
-
4beesdoo_shift_attendance/views/attendance_sheet.xml
-
2beesdoo_shift_attendance/views/res_config_settings_view.xml
-
4beesdoo_shift_attendance/wizard/validate_attendance_sheet.py
@ -1,61 +0,0 @@ |
|||
# Copyright 2019-2020 Elouan Le Bars <elouan@coopiteasy.be> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
import ast |
|||
|
|||
from odoo import fields, models, api |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
_inherit = "res.config.settings" |
|||
|
|||
card_support = fields.Boolean( |
|||
string="Scan cooperators cards instead of login for sheets validation", |
|||
config_parameter="beesdoo_shift.card_support", |
|||
) |
|||
pre_filled_task_type_id = fields.Many2one( |
|||
"beesdoo.shift.type", |
|||
string="Default Task Type", |
|||
help="Default task type for attendance sheet pre-filling", |
|||
required=True, |
|||
default=False, |
|||
) |
|||
attendance_sheet_generation_interval = fields.Integer( |
|||
string="Time interval for attendance sheet generation", |
|||
help="Time interval expressed in minutes", |
|||
required=True, |
|||
config_parameter="beesdoo_shift.attendance_sheet_generation_interval", |
|||
) |
|||
|
|||
@api.multi |
|||
def set_values(self): |
|||
super(ResConfigSettings, self).set_values() |
|||
parameters = self.env["ir.config_parameter"].sudo() |
|||
parameters.set_param( |
|||
"beesdoo_shift.card_support", str(self.card_support), |
|||
) |
|||
parameters.set_param( |
|||
"beesdoo_shift.pre_filled_task_type_id", |
|||
str(self.pre_filled_task_type_id.id), |
|||
) |
|||
parameters.set_param( |
|||
"beesdoo_shift.attendance_sheet_generation_interval", |
|||
str(self.attendance_sheet_generation_interval), |
|||
) |
|||
|
|||
@api.multi |
|||
def get_values(self): |
|||
res = super(ResConfigSettings, self).get_values() |
|||
res.update( |
|||
card_support=ast.literal_eval( |
|||
self.env["ir.config_parameter"].get_param( |
|||
"beesdoo_shift.card_support" |
|||
), |
|||
), |
|||
pre_filled_task_type_id=int( |
|||
self.env["ir.config_parameter"].get_param( |
|||
"beesdoo_shift.pre_filled_task_type_id" |
|||
) |
|||
), |
|||
) |
|||
return res |
@ -1,14 +1,14 @@ |
|||
<odoo noupdate="1"> |
|||
<record id="beesdoo_shift.card_support" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift.card_support</field> |
|||
<record id="card_support" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift_attendance.card_support</field> |
|||
<field name="value">False</field> |
|||
</record> |
|||
<record id="beesdoo_shift.attendance_sheet_generation_interval" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift.attendance_sheet_generation_interval</field> |
|||
<record id="attendance_sheet_generation_interval" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift_attendance.attendance_sheet_generation_interval</field> |
|||
<field name="value">15</field> |
|||
</record> |
|||
<record id="beesdoo_shift.default_task_type_id" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift.default_task_type_id</field> |
|||
<record id="default_task_type_id" model="ir.config_parameter"> |
|||
<field name="key">beesdoo_shift_attendance.default_task_type_id</field> |
|||
<field name="value">1</field> |
|||
</record> |
|||
</odoo> |
@ -1,11 +1,14 @@ |
|||
<odoo> |
|||
<record id="group_shift_attendance_sheet" model="res.groups"> |
|||
<field name="name">Attendance Sheet Generic Access</field> |
|||
<field name="category_id" |
|||
ref="base.module_category_cooperative_management"/> |
|||
</record> |
|||
<record id="beesdoo_shift.group_shift_attendance" model="res.groups"> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('group_shift_attendance_sheet'))]"/> |
|||
</record> |
|||
<record id="group_shift_attendance_sheet" model="res.groups"> |
|||
<field name="name">Attendance Sheet Generic Access</field> |
|||
<field name="category_id" ref="base.module_category_cooperative_management"/> |
|||
</record> |
|||
<record id="group_shift_attendance_sheet_validation" model="res.groups"> |
|||
<field name="name">Attendance Sheet Validation</field> |
|||
<field name="category_id" ref="base.module_category_cooperative_management"/> |
|||
<field name="implied_ids" eval="[(4, ref('group_shift_attendance_sheet'))]"/> |
|||
</record> |
|||
<record id="beesdoo_shift.group_shift_attendance" model="res.groups"> |
|||
<field name="implied_ids" eval="[(4, ref('group_shift_attendance_sheet'))]"/> |
|||
</record> |
|||
</odoo> |
@ -1,12 +1,12 @@ |
|||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink |
|||
create_beesdoo_shift_shift,create_edit_beesdoo_shift_shift,model_beesdoo_shift_shift,group_shift_attendance_sheet,1,1,1,0 |
|||
create_beesdoo_shift_shift,create_edit_beesdoo_shift_shift,beesdoo_shift.model_beesdoo_shift_shift,group_shift_attendance_sheet,1,1,1,0 |
|||
read_beesdoo_shift_sheet_shift,read_beesdoo_shift_sheet_shift,model_beesdoo_shift_sheet_shift,group_shift_attendance_sheet,1,0,0,0 |
|||
create_beesdoo_shift_sheet_shift,create_beesdoo_shift_sheet_shift,model_beesdoo_shift_sheet_shift,group_shift_attendance_sheet,1,1,1,0 |
|||
create_beesdoo_shift_sheet_expected,create_beesdoo_shift_sheet_expected,model_beesdoo_shift_sheet_expected,group_shift_attendance_sheet,1,1,1,0 |
|||
manage_beesdoo_shift_sheet_added,manage_beesdoo_shift_sheet_added,model_beesdoo_shift_sheet_added,group_shift_attendance_sheet,1,1,1,1 |
|||
create_beesdoo_shift_sheet,create_beesdoo_shift_sheet,model_beesdoo_shift_sheet,group_shift_attendance_sheet,1,1,1,0 |
|||
sheet_access_beesdoo_shift_template,sheet_access_beesdoo_shift_template,model_beesdoo_shift_template,group_shift_attendance_sheet,1,0,0,0 |
|||
sheet_access_beesdoo_shift_type,sheet_access_beesdoo_shift_type,model_beesdoo_shift_type,group_shift_attendance_sheet,1,0,0,0 |
|||
access_beesdoo_shift_daynumber,access_beesdoo_shift_daynumber,model_beesdoo_shift_daynumber,group_shift_attendance_sheet,1,0,0,0 |
|||
manage_beesdoo_shift_sheet_shift,beesdoo_shift_sheet_shift,model_beesdoo_shift_sheet_shift,group_shift_attendance,1,1,1,1 |
|||
manage_beesdoo_shift_sheet_expected,manage_beesdoo_shift_sheet_expected,model_beesdoo_shift_sheet_expected,group_shift_attendance,1,1,1,1 |
|||
sheet_access_beesdoo_shift_template,sheet_access_beesdoo_shift_template,beesdoo_shift.model_beesdoo_shift_template,group_shift_attendance_sheet,1,0,0,0 |
|||
sheet_access_beesdoo_shift_type,sheet_access_beesdoo_shift_type,beesdoo_shift.model_beesdoo_shift_type,group_shift_attendance_sheet,1,0,0,0 |
|||
access_beesdoo_shift_daynumber,access_beesdoo_shift_daynumber,beesdoo_shift.model_beesdoo_shift_daynumber,group_shift_attendance_sheet,1,0,0,0 |
|||
manage_beesdoo_shift_sheet_shift,beesdoo_shift_sheet_shift,model_beesdoo_shift_sheet_shift,beesdoo_shift.group_shift_attendance,1,1,1,1 |
|||
manage_beesdoo_shift_sheet_expected,manage_beesdoo_shift_sheet_expected,model_beesdoo_shift_sheet_expected,beesdoo_shift.group_shift_attendance,1,1,1,1 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue