Skip to content

Commit

Permalink
Merge 1b45b5b into d39d80e
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevhe18 committed Nov 11, 2020
2 parents d39d80e + 1b45b5b commit 6ab0320
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 22 deletions.
19 changes: 11 additions & 8 deletions hr_timesheet_computation_overtime/README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===============================================
Timesheet Computation Integration With Overtime
===============================================

.. |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_computation_overtime
:alt: open-synergy/opnsynid-hr


Installation
============
Expand All @@ -32,8 +35,8 @@ Contributors
Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com
.. image:: https://simetri-sinergi.id/logo.png
:alt: PT. Simetri Sinergi Indonesia
:target: https://simetri-sinergi.id.com

This module is maintained by the OpenSynergy Indonesia.
This module is maintained by the PT. Simetri Sinergi Indonesia.
6 changes: 4 additions & 2 deletions hr_timesheet_computation_overtime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import (
models,
)
12 changes: 9 additions & 3 deletions hr_timesheet_computation_overtime/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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 Computation Integration With Overtime",
"version": "8.0.1.1.0",
"version": "8.0.1.2.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"website": "https://simetri-sinergi.id",
"author": "OpenSynergy Indonesia, PT. Simetri Sinergi Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
Expand All @@ -15,7 +17,11 @@
],
"data": [
"data/ir_actions_server_data.xml",
"views/hr_overtime_config_setting_views.xml",
"views/hr_timesheet_sheet_views.xml",
"views/hr_overtime_request_views.xml",
],
"images": [
"static/description/banner.png",
],
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
Copyright 2020 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>

Expand Down
12 changes: 8 additions & 4 deletions hr_timesheet_computation_overtime/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_timesheet_computation_item
from . import hr_timesheet_sheet
from . import hr_overtime_request
from . import (
res_company,
res_config,
hr_timesheet_computation_item,
hr_timesheet_sheet,
hr_overtime_request,
)
16 changes: 15 additions & 1 deletion hr_timesheet_computation_overtime/models/hr_overtime_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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
from openerp.exceptions import Warning as UserError
from openerp.tools.translate import _


class HrOvertimeRequest(models.Model):
Expand Down Expand Up @@ -38,3 +40,15 @@ def _compute_sheet(self):
@api.multi
def button_link_to_timesheet(self):
return self._compute_sheet()

@api.constrains(
"sheet_id",
"state",
)
def _check_timesheet(self):
if (
self.state in ["confirm", "valid"] and not
self.sheet_id and
self.company_id.overtime_check_timesheet
):
raise UserError(_("Timesheet cannot be empty"))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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


Expand Down
13 changes: 13 additions & 0 deletions hr_timesheet_computation_overtime/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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 ResCompany(models.Model):
_inherit = "res.company"

overtime_check_timesheet = fields.Boolean(
string="Check Timesheet",
)
14 changes: 14 additions & 0 deletions hr_timesheet_computation_overtime/models/res_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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.overtime_config_setting"

overtime_check_timesheet = fields.Boolean(
string="Check Timesheet",
related="company_id.overtime_check_timesheet",
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified hr_timesheet_computation_overtime/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 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_overtime_config_setting_view_form" model="ir.ui.view">
<field name="name">hr.overtime_config_setting form</field>
<field name="model">hr.overtime_config_setting</field>
<field name="inherit_id" ref="hr_attendance_overtime_request.hr_overtime_config_setting_view_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='overtime_config']" position="inside">
<label for="id" string="Timesheet Computation Overtime"/>
<div>
<div>
<label for="id" string="Check Timesheet" class="oe_inline"/>
<field name="overtime_check_timesheet" class="oe_inline"/>
</div>
</div>
</xpath>
</field>
</record>
</data>
</openerp>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
Copyright 2020 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
Copyright 2020 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

Expand Down

0 comments on commit 6ab0320

Please sign in to comment.