diff --git a/hr_timesheet_sheet_sequence_configurator/README.rst b/hr_timesheet_sheet_sequence_configurator/README.rst new file mode 100644 index 0000000..83a595f --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/README.rst @@ -0,0 +1,43 @@ +===================================== +Timesheet Sheet Sequence Configurator +===================================== + +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-open--synergy%2Fopnsynid--hr-lightgray.png?logo=github + :target: https://github.com/open-synergy/opnsynid-hr/tree/8.0/hr_timesheet_sequence_configurator + :alt: open-synergy/opnsynid-hr + +|badge2| |badge3| + + +Installation +============ + +To install this module, you need to: + +1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-hr +2. Add the path to this repository in your configuration (addons-path) +3. Update the module list +4. Go to menu *Setting -> Modules -> Local Modules* +5. Search For *Timesheet Sheet Sequence Configurator* +6. Install the module + +Credits +======= + +Contributors +------------ + +* Michael Viriyananda +* Andhitia Rama + +Maintainer +---------- + +.. image:: https://simetri-sinergi.id/logo.png + :alt: PT. Simetri Sinergi Indonesia + :target: https://simetri-sinergi.id.com + +This module is maintained by the PT. Simetri Sinergi Indonesia. diff --git a/hr_timesheet_sheet_sequence_configurator/__init__.py b/hr_timesheet_sheet_sequence_configurator/__init__.py new file mode 100644 index 0000000..95b3a45 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import ( + models, +) diff --git a/hr_timesheet_sheet_sequence_configurator/__openerp__.py b/hr_timesheet_sheet_sequence_configurator/__openerp__.py new file mode 100644 index 0000000..5d9a5c5 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/__openerp__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# pylint: disable=locally-disabled, manifest-required-author +{ + "name": "Timesheet Sheet Sequence Configurator", + "version": "8.0.1.0.0", + "category": "Human Resource", + "website": "https://simetri-sinergi.id", + "author": "OpenSynergy Indonesia, PT. Simetri Sinergi Indonesia", + "license": "AGPL-3", + "installable": True, + "depends": [ + "hr_timesheet_sheet", + "base_sequence_configurator", + ], + "data": [ + "data/ir_sequence_data.xml", + "data/base_sequence_configurator_data.xml", + "views/hr_attendance_config_setting_views.xml", + ], + "images": [ + "static/description/banner.png", + ], +} diff --git a/hr_timesheet_sheet_sequence_configurator/data/base_sequence_configurator_data.xml b/hr_timesheet_sheet_sequence_configurator/data/base_sequence_configurator_data.xml new file mode 100644 index 0000000..7413c5a --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/data/base_sequence_configurator_data.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + result = document.company_id.timesheet_sheet_sequence_id + + + diff --git a/hr_timesheet_sheet_sequence_configurator/data/ir_sequence_data.xml b/hr_timesheet_sheet_sequence_configurator/data/ir_sequence_data.xml new file mode 100644 index 0000000..5ea9812 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/data/ir_sequence_data.xml @@ -0,0 +1,25 @@ + + + + + + + Timesheet + hr_timesheet_sheet.sheet + + + + + + + Timeseet + hr_timesheet_sheet.sheet + 5 + TIMESHEET/%(year)s/ + + + + + diff --git a/hr_timesheet_sheet_sequence_configurator/models/__init__.py b/hr_timesheet_sheet_sequence_configurator/models/__init__.py new file mode 100644 index 0000000..db9ae46 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/models/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import ( + hr_timesheet_sheet_sheet, + res_company, + res_config, +) diff --git a/hr_timesheet_sheet_sequence_configurator/models/hr_timesheet_sheet_sheet.py b/hr_timesheet_sheet_sequence_configurator/models/hr_timesheet_sheet_sheet.py new file mode 100644 index 0000000..b342318 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/models/hr_timesheet_sheet_sheet.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import models, api, fields + + +class HrTimesheetSheetSheet(models.Model): + _name = "hr_timesheet_sheet.sheet" + _inherit = [ + "hr_timesheet_sheet.sheet", + "base.sequence_document", + ] + + name = fields.Char( + default="/", + copy=False, + ) + + @api.model + def create(self, values): + _super = super(HrTimesheetSheetSheet, self) + result = _super.create(values) + sequence = result._create_sequence() + result.write({ + "name": sequence, + }) + return result + + @api.multi + def name_get(self): + _super = super(HrTimesheetSheetSheet, self) + res = _super.name_get() + result = [] + for rec in self: + if rec.name: + result.append((rec.id, rec.name)) + else: + result = res + return result diff --git a/hr_timesheet_sheet_sequence_configurator/models/res_company.py b/hr_timesheet_sheet_sequence_configurator/models/res_company.py new file mode 100644 index 0000000..8fc0c95 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/models/res_company.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import models, fields, api + + +class ResCompany(models.Model): + _inherit = "res.company" + + timesheet_sheet_sequence_id = fields.Many2one( + string="Timesheet Sheet Sequence", + comodel_name="ir.sequence", + ) diff --git a/hr_timesheet_sheet_sequence_configurator/models/res_config.py b/hr_timesheet_sheet_sequence_configurator/models/res_config.py new file mode 100644 index 0000000..ce19536 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/models/res_config.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 OpenSynergy Indonesia +# Copyright 2020 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import models, fields + + +class ResConfig(models.TransientModel): + _inherit = "hr.attendance_config_setting" + + timesheet_sheet_sequence_id = fields.Many2one( + string="Timesheet Sheet Sequence", + comodel_name="ir.sequence", + related="company_id.timesheet_sheet_sequence_id", + store=False, + ) diff --git a/hr_timesheet_sheet_sequence_configurator/static/description/banner.png b/hr_timesheet_sheet_sequence_configurator/static/description/banner.png new file mode 100644 index 0000000..c93ebf1 Binary files /dev/null and b/hr_timesheet_sheet_sequence_configurator/static/description/banner.png differ diff --git a/hr_timesheet_sheet_sequence_configurator/static/description/icon.png b/hr_timesheet_sheet_sequence_configurator/static/description/icon.png new file mode 100644 index 0000000..4c8e112 Binary files /dev/null and b/hr_timesheet_sheet_sequence_configurator/static/description/icon.png differ diff --git a/hr_timesheet_sheet_sequence_configurator/views/hr_attendance_config_setting_views.xml b/hr_timesheet_sheet_sequence_configurator/views/hr_attendance_config_setting_views.xml new file mode 100644 index 0000000..9e95a10 --- /dev/null +++ b/hr_timesheet_sheet_sequence_configurator/views/hr_attendance_config_setting_views.xml @@ -0,0 +1,21 @@ + + + + + + hr.attendance_config_setting.sequence.form + hr.attendance_config_setting + + + +
+
+
+
+
+
+