-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by AaronHForgeFlow
- Loading branch information
Showing
18 changed files
with
802 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,89 @@ | ||
======================= | ||
Contract Operating Unit | ||
======================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:1bf7413f738eb06d7f40c5ea6903fd1ffcb6abe7994c8dfd04afa916149458b7 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |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-OCA%2Foperating--unit-lightgray.png?logo=github | ||
:target: https://github.com/OCA/operating-unit/tree/17.0/contract_operating_unit | ||
:alt: OCA/operating-unit | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/operating-unit-17-0/operating-unit-17-0-contract_operating_unit | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module introduces the following features: | ||
|
||
- Adds the Operating Unit (OU) to Contracts. | ||
- Security rules are defined to ensure that users can only see the | ||
Contracts of that Operating Units in which they are allowed access | ||
to. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
Assign contracts to specific operating units within the company | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20contract_operating_unit%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* ForgeFlow S.L. | ||
|
||
Contributors | ||
------------ | ||
|
||
- Aaron Henriquez <[email protected]> | ||
- Kitti U. <[email protected]> | ||
- Pimolnat Suntian <[email protected]> | ||
- Tran Thanh Trai <[email protected]> | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/17.0/contract_operating_unit>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
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,14 @@ | ||
# Copyright 2020 ForgeFlow S.L. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Contract Operating Unit", | ||
"version": "17.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "ForgeFlow S.L., Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/operating-unit", | ||
"category": "Invoicing", | ||
"depends": ["contract", "account_operating_unit"], | ||
"data": ["views/contract_view.xml", "security/contract_security.xml"], | ||
"installable": True, | ||
} |
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,25 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * contract_operating_unit | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: contract_operating_unit | ||
#: model:ir.model,name:contract_operating_unit.model_contract_contract | ||
msgid "Contract" | ||
msgstr "" | ||
|
||
#. module: contract_operating_unit | ||
#: model:ir.model.fields,field_description:contract_operating_unit.field_contract_contract__operating_unit_id | ||
#: model_terms:ir.ui.view,arch_db:contract_operating_unit.contract_contract_search_view | ||
msgid "Operating Unit" | ||
msgstr "" |
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 @@ | ||
from . import contract |
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,22 @@ | ||
# Copyright 2020 ForgeFlow S.L. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ContractContract(models.Model): | ||
_inherit = "contract.contract" | ||
|
||
operating_unit_id = fields.Many2one( | ||
"operating.unit", | ||
"Operating Unit", | ||
default=lambda self: self.env["res.users"]._get_default_operating_unit( | ||
self._uid | ||
), | ||
) | ||
|
||
def _prepare_invoice(self, date_invoice, journal=None): | ||
invoice_vals = super()._prepare_invoice(date_invoice, journal=journal) | ||
if self.operating_unit_id: | ||
invoice_vals["operating_unit_id"] = self.operating_unit_id.id | ||
return invoice_vals |
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,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
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,4 @@ | ||
- Aaron Henriquez \<<[email protected]>\> | ||
- Kitti U. \<<[email protected]>\> | ||
- Pimolnat Suntian \<<[email protected]>\> | ||
- Tran Thanh Trai \<<[email protected]>\> |
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,5 @@ | ||
This module introduces the following features: | ||
|
||
- Adds the Operating Unit (OU) to Contracts. | ||
- Security rules are defined to ensure that users can only see the | ||
Contracts of that Operating Units in which they are allowed access to. |
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 @@ | ||
Assign contracts to specific operating units within the company |
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 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="ir_rule_contract_allowed_operating_units" model="ir.rule"> | ||
<field name="model_id" ref="contract.model_contract_contract" /> | ||
<field | ||
name="domain_force" | ||
>['|',('operating_unit_id','=',False),('operating_unit_id','in',[g.id for g in user.operating_unit_ids])]</field> | ||
<field name="name">Contracts from allowed operating units</field> | ||
<field name="global" eval="True" /> | ||
<field eval="0" name="perm_unlink" /> | ||
<field eval="0" name="perm_write" /> | ||
<field eval="1" name="perm_read" /> | ||
<field eval="0" name="perm_create" /> | ||
</record> | ||
|
||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.