Skip to content

Commit

Permalink
Merge PR #1070 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Feb 22, 2023
2 parents afebb67 + 11879e7 commit 5338f01
Show file tree
Hide file tree
Showing 25 changed files with 3,944 additions and 0 deletions.
126 changes: 126 additions & 0 deletions project_wbs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
================================
Project Work Breakdown Structure
================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/12.0/project_wbs
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_wbs
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/140/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

Adding WBS information to Odoo Projects

* The hierarchy of a project is considered the WBS
(Work Breakdown Structure)
* The analytic accounts in the project hierarchies are considered WBS
components
* The analytic account code is shown in the project
* The complete WBS path code is shown in the analytic account and in the
project
* The complete WBS path name is shown in the analytic account and in the
project
* The WBS paths are concatenated with each other

Searching and Browsing WBS

* It is possible to search projects by complete WBS path code & name
* It is possible to search tasks by project complete WBS path code & name
* The WBS components can be classified as project, phase, deliverable,
work package.
* The classification is shown in the project and analytic account views
* A project stage attribute is incorporated in the analytic account and
displayed in the project and analytic account views.

**Table of contents**

.. contents::
:local:

Usage
=====

Create a new child:

#. Go to Project > WBS
#. Click on one existing project or create a new one
#. Click on the form view to open the project.
#. Go to Work Breakdown Structure to create a new child

Navigation:

* Level column indicates the child hierarchy: '>' means it is a child. '>>'
means it is a grandchild an so on.
* Click on the up arrow to see the parent project.
* Click on the down arrow to see children projects.

Known issues / Roadmap
======================

* Actions for the different account class are implemented but menus for those
were not included. This is for inheritance purposes.
* RTL-friendliness in Project codes and names
* Do not show full names in children in Kanban View

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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 <https://github.com/OCA/project/issues/new?body=module:%20project_wbs%0Aversion:%2012.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
~~~~~~~

* Matmoz d.o.o.
* Luxim d.o.o.
* Deneroteam
* Eficent

Contributors
~~~~~~~~~~~~

* Eficent <http://www.eficent.com>
* Luxim d.o.o. <http://www.luxim.si>
* Matmoz d.o.o. <http://www.matmoz.si>
* Deneroteam. <[email protected]>
* SerpentCS <http://www.serpentcs.com>

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/project <https://github.com/OCA/project/tree/12.0/project_wbs>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions project_wbs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import pre_init_hook
29 changes: 29 additions & 0 deletions project_wbs/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2017-19 Eficent Business and IT Consulting Services S.L.
# Copyright 2017 Luxim d.o.o.
# Copyright 2017 Matmoz d.o.o.
# Copyright 2017 Deneroteam.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Project Work Breakdown Structure",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "Matmoz d.o.o., "
"Luxim d.o.o., "
"Deneroteam, "
"Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"depends": [
"account_analytic_parent",
"account_analytic_sequence",
"hr_timesheet",
],
"summary": "Apply Work Breakdown Structure",
"data": [
"view/account_analytic_account_view.xml",
"view/project_project_view.xml",
],
"pre_init_hook": "pre_init_hook",
"installable": True,
}
29 changes: 29 additions & 0 deletions project_wbs/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging

from odoo.api import SUPERUSER_ID, Environment

logger = logging.getLogger(__name__)


def pre_init_hook(cr):
env = Environment(cr, SUPERUSER_ID, {})
# avoid crashing installation because of having same complete_wbs_code
for aa in (
env["account.analytic.account"]
.with_context(active_test=False)
.search([("code", "=", False)])
):
aa._write(
{"code": env["ir.sequence"].next_by_code("account.analytic.account.code")}
)
logger.info("Assigning default code to existing analytic accounts")

projects = (
env["project.project"]
.with_context(active_test=False)
.search([("analytic_account_id", "=", False)])
)
projects._create_analytic_account()
projects.filtered(lambda p: not p.active).mapped("analytic_account_id").write(
{"active": False}
)
Loading

0 comments on commit 5338f01

Please sign in to comment.