-
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.
[hr_contract_sequence_configurator] 8.0.1.0.0
- Loading branch information
Showing
11 changed files
with
200 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,40 @@ | ||
.. 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 | ||
|
||
============================= | ||
Expense Sequence Configurator | ||
============================= | ||
|
||
|
||
|
||
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 *Expense Sequence Configurator* | ||
6. Install the module | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Michael Viriyananda <viriyananda.michael@gmail.com> | ||
* Andhitia Rama <andhitia.r@gmail.com> | ||
|
||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://opensynergy-indonesia.com/logo.png | ||
:alt: OpenSynergy Indonesia | ||
:target: https://opensynergy-indonesia.com | ||
|
||
This module is maintained by the OpenSynergy 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,8 @@ | ||
# -*- 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": "Expense 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_contract", | ||
"base_sequence_configurator", | ||
], | ||
"data": [ | ||
"data/ir_sequence_data.xml", | ||
"data/base_sequence_configurator_data.xml", | ||
"views/hr_contract_type_views.xml", | ||
], | ||
"images": [ | ||
"static/description/banner.png", | ||
], | ||
} |
20 changes: 20 additions & 0 deletions
20
hr_contract_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 2018 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<openerp> | ||
<data> | ||
<!-- Training --> | ||
<record id="base_sequence_hr_contract" model="base.sequence_configurator"> | ||
<field name="model_id" ref="hr_contract.model_hr_contract"/> | ||
<field name="sequence_field_id" search="[('model_id.model','=','hr.contract'),('name','=','name')]"/> | ||
<field name="fallback_sequence_id" ref="hr_contract_sequence_configurator.sequence_hr_contract"/> | ||
</record> | ||
|
||
<record id="base_sequence_hr_contract_line" model="base.sequence_configurator_line"> | ||
<field name="generator_id" ref="hr_contract_sequence_configurator.base_sequence_hr_contract"/> | ||
<field name="sequence" eval="1"/> | ||
<field name="sequence_computation_code">result = document.type_id.sequence_id</field> | ||
</record> | ||
</data> | ||
</openerp> |
24 changes: 24 additions & 0 deletions
24
hr_contract_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,24 @@ | ||
<?xml version="1.0"?> | ||
<!-- Copyright 2020 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0) --> | ||
<openerp> | ||
<data> | ||
|
||
<record id="seq_type_hr_contract" model="ir.sequence.type"> | ||
<field name="name">Employee Contract</field> | ||
<field name="code">hr.contract</field> | ||
</record> | ||
|
||
</data> | ||
|
||
<data noupdate="1"> | ||
<record id="sequence_hr_contract" model="ir.sequence"> | ||
<field name="name">Employee Contract</field> | ||
<field name="code">hr.contract</field> | ||
<field name="padding">6</field> | ||
<field name="prefix">CTR/%(y)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_contract, | ||
hr_contract_type, | ||
) |
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,33 @@ | ||
# -*- 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 HrContract(models.Model): | ||
_name = "hr.contract" | ||
_inherit = [ | ||
"hr.contract", | ||
"base.sequence_document", | ||
] | ||
|
||
@api.model | ||
def _default_name(self): | ||
return "/" | ||
|
||
name = fields.Char( | ||
default=lambda self: self._default_name(), | ||
string="# Document", | ||
) | ||
|
||
@api.model | ||
def create(self, values): | ||
_super = super(HrContract, self) | ||
result = _super.create(values) | ||
sequence = result._create_sequence() | ||
result.write({ | ||
"name": sequence, | ||
}) | ||
return result |
17 changes: 17 additions & 0 deletions
17
hr_contract_sequence_configurator/models/hr_contract_type.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,17 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2018-2019 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 HrContractType(models.Model): | ||
_name = "hr.contract.type" | ||
_inherit = "hr.contract.type" | ||
|
||
sequence_id = fields.Many2one( | ||
string="Sequence", | ||
comodel_name="ir.sequence", | ||
company_dependent=True, | ||
) |
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.
23 changes: 23 additions & 0 deletions
23
hr_contract_sequence_configurator/views/hr_contract_type_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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2018-2019 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_contract_type_view_form" model="ir.ui.view"> | ||
<field name="name">hr.contract.type form</field> | ||
<field name="model">hr.contract.type</field> | ||
<field name="inherit_id" ref="hr_contract.hr_contract_type_view_form"/> | ||
<field name="arch" type="xml"> | ||
<data> | ||
<xpath expr="//field[@name='name']" position="after"> | ||
<field name="sequence_id" colspan="4" domain="[('code','=','hr.contract')]"/> | ||
</xpath> | ||
</data> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</openerp> |