-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.0.1.0.0][hr_timesheet_sheet_sequence_configurator]
- Loading branch information
Showing
12 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <viriyananda.michael@gmail.com> | ||
* Andhitia Rama <andhitia.r@gmail.com> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
], | ||
} |
20 changes: 20 additions & 0 deletions
20
hr_timesheet_sheet_sequence_configurator/data/base_sequence_configurator_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2020 OpenSynergy Indonesia | ||
Copyright 2020 PT. Simetri Sinergi Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<openerp> | ||
<data> | ||
<record id="base_sequence_hr_timesheet_sheet" model="base.sequence_configurator"> | ||
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/> | ||
<field name="sequence_field_id" search="[('model_id.model','=','hr_timesheet_sheet.sheet'),('name','=','name')]"/> | ||
<field name="fallback_sequence_id" ref="hr_timesheet_sheet_sequence_configurator.sequence_hr_timesheet_sheet"/> | ||
</record> | ||
|
||
<record id="base_sequence_hr_timesheet_sheet_line" model="base.sequence_configurator_line"> | ||
<field name="generator_id" ref="base_sequence_hr_timesheet_sheet"/> | ||
<field name="sequence" eval="1"/> | ||
<field name="sequence_computation_code">result = document.company_id.timesheet_sheet_sequence_id</field> | ||
</record> | ||
</data> | ||
</openerp> |
25 changes: 25 additions & 0 deletions
25
hr_timesheet_sheet_sequence_configurator/data/ir_sequence_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<!-- Copyright 2020 OpenSynergy Indonesia | ||
Copyright 2020 PT. Simetri Sinergi Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<openerp> | ||
<data> | ||
|
||
<record id="seq_type_hr_timesheet_sheet" model="ir.sequence.type"> | ||
<field name="name">Timesheet</field> | ||
<field name="code">hr_timesheet_sheet.sheet</field> | ||
</record> | ||
|
||
</data> | ||
|
||
<data noupdate="1"> | ||
<record id="sequence_hr_timesheet_sheet" model="ir.sequence"> | ||
<field name="name">Timeseet</field> | ||
<field name="code">hr_timesheet_sheet.sheet</field> | ||
<field name="padding">5</field> | ||
<field name="prefix">TIMESHEET/%(year)s/</field> | ||
<field eval="1" name="number_next"/> | ||
<field eval="1" name="number_increment"/> | ||
</record> | ||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
40 changes: 40 additions & 0 deletions
40
hr_timesheet_sheet_sequence_configurator/models/hr_timesheet_sheet_sheet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
14 changes: 14 additions & 0 deletions
14
hr_timesheet_sheet_sequence_configurator/models/res_company.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
) |
16 changes: 16 additions & 0 deletions
16
hr_timesheet_sheet_sequence_configurator/models/res_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
Binary file added
BIN
+339 KB
hr_timesheet_sheet_sequence_configurator/static/description/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
hr_timesheet_sheet_sequence_configurator/views/hr_attendance_config_setting_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2020 OpenSynergy Indonesia | ||
Copyright 2020 PT. Simetri Sinergi Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<openerp> | ||
<data> | ||
<record id="hr_attendance_config_setting_view_form" model="ir.ui.view"> | ||
<field name="name">hr.attendance_config_setting.sequence.form</field> | ||
<field name="model">hr.attendance_config_setting</field> | ||
<field name="inherit_id" ref="hr_attendance_configuration_page.hr_attendance_config_setting_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[@name='general_configuration']" position="after"> | ||
<div> | ||
<label for="id" string="Timesheet Sheet Sequence" class="oe_inline"/> | ||
<field name="timesheet_sheet_sequence_id" class="oe_inline"/> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |