-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] hr_operating_unit: add OU to department and fix domain users
- Loading branch information
Showing
12 changed files
with
100 additions
and
18 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
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import hr_department | ||
from . import hr_employee_base | ||
from . import hr_operating_unit |
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,13 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class Department(models.Model): | ||
_inherit = "hr.department" | ||
|
||
operating_unit_id = fields.Many2one( | ||
comodel_name="operating.unit", | ||
string="Operating Unit", | ||
default=lambda self: (self.env["res.users"].operating_unit_default_get()), | ||
) |
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
* Gonzalo González Domínguez <meigallo@meigallodixital.com> | ||
* Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.com> | ||
* Pimolnat Suntian <pimolnats@ecosoft.co.th> |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
This module introduces the following features: | ||
|
||
* Adds the Operating Unit (OU) to the Employee. | ||
* Adds the Operating Unit (OU) to the Employee/Department. | ||
|
||
* The Employees's default Operating Unit (OU) is proposed at the time of creation | ||
getting it from the logged user. |
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 |
---|---|---|
@@ -1 +1 @@ | ||
Add the operating unit to Employee | ||
Add the operating unit to Employee/Department |
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
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
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_department_form" model="ir.ui.view"> | ||
<field name="model">hr.department</field> | ||
<field name="inherit_id" ref="hr.view_department_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="parent_id" position="after"> | ||
<field | ||
name="operating_unit_id" | ||
options="{'no_create': True}" | ||
domain="[('company_id','=', company_id)]" | ||
groups="operating_unit.group_multi_operating_unit" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="view_department_tree" model="ir.ui.view"> | ||
<field name="model">hr.department</field> | ||
<field name="inherit_id" ref="hr.view_department_tree" /> | ||
<field name="arch" type="xml"> | ||
<field name="parent_id" position="after"> | ||
<field | ||
name="operating_unit_id" | ||
groups="operating_unit.group_multi_operating_unit" | ||
optional="hide" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="view_department_filter" model="ir.ui.view"> | ||
<field name="model">hr.department</field> | ||
<field name="inherit_id" ref="hr.view_department_filter" /> | ||
<field name="arch" type="xml"> | ||
<field name="manager_id" position="after"> | ||
<field name="operating_unit_id" /> | ||
</field> | ||
<filter name="inactive" position="after"> | ||
<filter | ||
string="Operating Unit" | ||
name="operating_unit_id" | ||
context="{'group_by': 'operating_unit_id'}" | ||
/> | ||
</filter> | ||
</field> | ||
</record> | ||
</odoo> |
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