Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] new module pms hr property #244

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pms_hr_property/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions pms_hr_property/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 OsoTranquilo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
'name': 'PMS Hr Property',
'summary': """
Adds to the employee the property on which he works.""",
'version': '14.0.1.0.0',
'license': 'AGPL-3',
'author': 'OsoTranquilo,Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/pms',
"category": "PMS/HR",
'depends': [
"hr",
"pms",
],
'data': [
'views/hr_employee_view.xml',
],
"installable": True,
}
1 change: 1 addition & 0 deletions pms_hr_property/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_employee
12 changes: 12 additions & 0 deletions pms_hr_property/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2023 OsoTranquilo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import _, api, fields, models


class HrEmployeeBase(models.AbstractModel):

_inherit = "hr.employee.base"

property_ids = fields.Many2many("pms.property", string="Workplaces asigned")
1 change: 1 addition & 0 deletions pms_hr_property/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Jose Luis Algara <osotranquilo@gmail.com>
7 changes: 7 additions & 0 deletions pms_hr_property/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file is optional and contains additional credits, other than
authors, contributors, and maintainers. ]

The development of this module has been financially supported by:

- Alda Hotels
- Consultores Hoteleros Integrales
3 changes: 3 additions & 0 deletions pms_hr_property/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module extends the functionality of hr to support multiproperty in PMS.
Allow you to select workplaces/properties for the employee.

Binary file added pms_hr_property/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.
47 changes: 47 additions & 0 deletions pms_hr_property/views/hr_employee_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_property_employee_view_form" model="ir.ui.view">
<field name="name">hr.property.employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='coach_id']" position="after">
<field name="property_ids" widget="many2many_tags" options="{'no_create': True}" />
</xpath>
</field>
</record>

<record model="ir.ui.view" id="hr_property_employee_view_tree">
<field name="name">hr.property.employee.tree</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='job_id']" position="after">
<field name="property_ids" widget="many2many_tags" options="{'no_create': True}" />
</xpath>
</field>
</record>

<record model="ir.ui.view" id="hr_property_employee_view_kanban">
<field name="name">hr.property.employee.kanban</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees" />
<field name="arch" type="xml">
<xpath expr="//field[@name='work_phone']" position="after">
<div role="separator" class="dropdown-divider" />
<field name="property_ids" widget="many2many_tags" options="{'no_create': True}" />
</xpath>
</field>
</record>

<record model="ir.ui.view" id="hr_property_employee_filter">
<field name="name">hr.property.employee.filter</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter" />
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after">
<field name="property_ids" string="Workplace" enable_counters="1" select="multi" />
</xpath>
</field>
</record>
</odoo>
Loading