Skip to content

Commit

Permalink
Merge pull request #316 from leemannd/10.0-mig-hr_contract_reference
Browse files Browse the repository at this point in the history
[MIG] hr_contract_reference: Migrated to 10.0
  • Loading branch information
gurneyalex committed Mar 1, 2017
2 parents cfec621 + d06cdea commit bdada88
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 108 deletions.
13 changes: 11 additions & 2 deletions hr_contract_reference/README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

HR Contract Reference
=====================
Expand All @@ -13,7 +14,7 @@ Installation

To install this module, you need to:

* clone the branch 8.0 of the repository https://github.com/OCA/hr
* clone the branch 10.0 of the repository https://github.com/OCA/hr
* add the path to this repository in your configuration (addons-path)
* update the module list
* search for "HR Contract Reference" in your addons
Expand All @@ -33,6 +34,13 @@ Usage
When you will create a new employee contract, the field reference will be
assigned automatically with the next number of the predefined sequence.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Expand All @@ -41,6 +49,7 @@ Contributors

* Michael Telahun Makonnen <mmakonnen@gmail.com>
* Fekete Mihai <feketemihai@gmail.com>
* Denis Leemann <denis.leemann@camptocamp.com>

Maintainer
----------
Expand Down
23 changes: 3 additions & 20 deletions hr_contract_reference/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# copyright 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
27 changes: 5 additions & 22 deletions hr_contract_reference/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# copyright 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "HR Contract Reference",
"version": "8.0.1.0.0",
"version": "10.0.1.0.0",
"category": "Generic Modules/Human Resources",
"author": 'Michael Telahun Makonnen, '
'Fekete Mihai (Forest and Biomass Services Romania), '
Expand All @@ -32,5 +15,5 @@
'views/hr_contract_view.xml',
'data/hr_contract_sequence.xml',
],
'installable': False,
'installable': True,
}
8 changes: 2 additions & 6 deletions hr_contract_reference/data/hr_contract_sequence.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data noupdate="1">
<record id="seq_type_contract_ref" model="ir.sequence.type">
<field name="name">Contract Reference</field>
<field name="code">contract.ref</field>
</record>
<record id="seq_contract_ref" model="ir.sequence">
<field name="name">Contract Reference</field>
<field name="code">contract.ref</field>
<field name="prefix">EC/%(year)s/</field>
<field name="padding">5</field>
</record>
</data>
</openerp>
</odoo>
23 changes: 3 additions & 20 deletions hr_contract_reference/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# copyright 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import hr_contract
29 changes: 6 additions & 23 deletions hr_contract_reference/models/hr_contract.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# copyright 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api
from odoo import models, fields, api


class hr_contract(models.Model):
class HrContract(models.Model):
_inherit = 'hr.contract'

name = fields.Char('Contract Reference', required=False,
Expand All @@ -32,4 +15,4 @@ class hr_contract(models.Model):
def create(self, vals):
if vals.get('number', '/') == '/':
vals['name'] = self.env['ir.sequence'].next_by_code('contract.ref')
return super(hr_contract, self).create(vals)
return super(HrContract, self).create(vals)
27 changes: 12 additions & 15 deletions hr_contract_reference/views/hr_contract_view.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="hr_contract_view" model="ir.ui.view">
<field name="name">hr.contract.form.view.inherit.ref</field>
<field name="model">hr.contract</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<field name="name" position="replace">
<field name="name" readonly="1"/>
</field>
<odoo>
<record id="hr_contract_view" model="ir.ui.view">
<field name="name">hr.contract.form.view.inherit.ref</field>
<field name="model">hr.contract</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="readonly">True</attribute>
</field>
</record>
</data>
</openerp>
</field>
</record>
</odoo>

0 comments on commit bdada88

Please sign in to comment.