diff --git a/project_budget/README.rst b/project_budget/README.rst new file mode 100644 index 0000000000..4d1ded9603 --- /dev/null +++ b/project_budget/README.rst @@ -0,0 +1,97 @@ +============== +Project Budget +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:af6b189589d4535de3c3351375d803693302573ca1140a9a593c0ab83a2de53a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/project_budget + :alt: OCA/project +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_budget + :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/project&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module integrates the OCA Account Budget with Project. + +Budgets can be created and viewed directly from the project without the +need for additional accounting access. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Have user rights for Project Budget viewer or manager group. +2. Open a project and view the Budget tab. +3. Create a new budget. The budget lines are visible on the project. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Patrick Wilson + +Contributors +------------ + +- Patrick Wilson +- Maxime Chambreuil + +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. + +.. |maintainer-patrickrwilson| image:: https://github.com/patrickrwilson.png?size=40px + :target: https://github.com/patrickrwilson + :alt: patrickrwilson + +Current `maintainer `__: + +|maintainer-patrickrwilson| + +This module is part of the `OCA/project `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_budget/__init__.py b/project_budget/__init__.py new file mode 100644 index 0000000000..69f7babdfb --- /dev/null +++ b/project_budget/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/project_budget/__manifest__.py b/project_budget/__manifest__.py new file mode 100644 index 0000000000..e64ca17ed7 --- /dev/null +++ b/project_budget/__manifest__.py @@ -0,0 +1,25 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Project Budget", + "summary": "Adds budget management to projects.", + "author": "Patrick Wilson,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/project", + "category": "Project Management", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "depends": [ + "project", + "account_budget_oca", + "hr_timesheet", + ], + "data": [ + "security/project_security.xml", + "security/ir.model.access.csv", + "views/project.xml", + "views/account_budget.xml", + ], + "application": False, + "development_status": "Beta", + "maintainers": ["patrickrwilson"], +} diff --git a/project_budget/i18n/hr.po b/project_budget/i18n/hr.po new file mode 100644 index 0000000000..823e2dc36a --- /dev/null +++ b/project_budget/i18n/hr.po @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-12-02 16:28+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" +"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.9.1\n" + +#. module: project_budget +#: model:ir.model,name:project_budget.model_crossovered_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget" +msgstr "Proračun" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id_lines +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget Lines" +msgstr "Stavke proračuna" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_state +msgid "Budget Status" +msgstr "Status proračuna" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__analytic_account_id +msgid "Default Analytic Account" +msgstr "Zadani analitički konto" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_manager +msgid "Manager" +msgstr "Manager" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Planned Amount" +msgstr "Planirani iznos" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Practical Amount" +msgstr "Praktični iznos" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__project_id +msgid "Project" +msgstr "Projekt" + +#. module: project_budget +#: model:ir.module.category,name:project_budget.module_category_project_budget +msgid "Project Budget" +msgstr "Proračun projekta" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Project Period" +msgstr "Period projekta" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Theoretical Amount" +msgstr "Teoretski iznos" + +#. module: project_budget +#: model:ir.module.category,description:project_budget.module_category_project_budget +msgid "User access level for Project Budgets" +msgstr "Razina pristupnih prava za Proračune projekata" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_viewer +msgid "Viewer" +msgstr "Gledatelj" + +#. module: project_budget +#: model:ir.model,name:project_budget.model_project_project +msgid "WBS element" +msgstr "WBS element" diff --git a/project_budget/i18n/project_budget.pot b/project_budget/i18n/project_budget.pot new file mode 100644 index 0000000000..a3a012c2a2 --- /dev/null +++ b/project_budget/i18n/project_budget.pot @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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: project_budget +#: model:ir.model,name:project_budget.model_crossovered_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget" +msgstr "" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id_lines +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget Lines" +msgstr "" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_state +msgid "Budget Status" +msgstr "" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__analytic_account_id +msgid "Default Analytic Account" +msgstr "" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_manager +msgid "Manager" +msgstr "" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Planned Amount" +msgstr "" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Practical Amount" +msgstr "" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__project_id +msgid "Project" +msgstr "" + +#. module: project_budget +#: model:ir.module.category,name:project_budget.module_category_project_budget +msgid "Project Budget" +msgstr "" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Project Period" +msgstr "" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Theoretical Amount" +msgstr "" + +#. module: project_budget +#: model:ir.module.category,description:project_budget.module_category_project_budget +msgid "User access level for Project Budgets" +msgstr "" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_viewer +msgid "Viewer" +msgstr "" + +#. module: project_budget +#: model:ir.model,name:project_budget.model_project_project +msgid "WBS element" +msgstr "" + diff --git a/project_budget/i18n/sl.po b/project_budget/i18n/sl.po new file mode 100644 index 0000000000..619aa08bb8 --- /dev/null +++ b/project_budget/i18n/sl.po @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-31 10:14+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: project_budget +#: model:ir.model,name:project_budget.model_crossovered_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget" +msgstr "Proračun" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_id_lines +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Budget Lines" +msgstr "Postavke proračuna" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_project_project__budget_state +msgid "Budget Status" +msgstr "Status proračuna" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__analytic_account_id +msgid "Default Analytic Account" +msgstr "Privzeti analitični konto" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_manager +msgid "Manager" +msgstr "Upravitelj" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Planned Amount" +msgstr "Planirani znesek" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Practical Amount" +msgstr "Dejanski znesek" + +#. module: project_budget +#: model:ir.model.fields,field_description:project_budget.field_crossovered_budget__project_id +msgid "Project" +msgstr "Projekt" + +#. module: project_budget +#: model:ir.module.category,name:project_budget.module_category_project_budget +msgid "Project Budget" +msgstr "Projektni proračun" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Project Period" +msgstr "Projektno obdobje" + +#. module: project_budget +#: model_terms:ir.ui.view,arch_db:project_budget.project_budget_inherit_form +msgid "Theoretical Amount" +msgstr "Teoretični znesek" + +#. module: project_budget +#: model:ir.module.category,description:project_budget.module_category_project_budget +msgid "User access level for Project Budgets" +msgstr "Uporabniške dostopne pravice za projektne proračune" + +#. module: project_budget +#: model:res.groups,name:project_budget.group_project_budget_viewer +msgid "Viewer" +msgstr "Gledalec" + +#. module: project_budget +#: model:ir.model,name:project_budget.model_project_project +msgid "WBS element" +msgstr "Projektni člen" diff --git a/project_budget/models/__init__.py b/project_budget/models/__init__.py new file mode 100644 index 0000000000..8538b73458 --- /dev/null +++ b/project_budget/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import account_budget, project diff --git a/project_budget/models/account_budget.py b/project_budget/models/account_budget.py new file mode 100644 index 0000000000..bf950e83dc --- /dev/null +++ b/project_budget/models/account_budget.py @@ -0,0 +1,12 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CrossoveredBudget(models.Model): + _inherit = "crossovered.budget" + + project_id = fields.Many2one("project.project", string="Project") + analytic_account_id = fields.Many2one( + "account.analytic.account", string="Default Analytic Account" + ) diff --git a/project_budget/models/project.py b/project_budget/models/project.py new file mode 100644 index 0000000000..53a5b331e2 --- /dev/null +++ b/project_budget/models/project.py @@ -0,0 +1,15 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class Project(models.Model): + _inherit = "project.project" + + budget_id = fields.Many2one("crossovered.budget", string="Budget") + budget_id_lines = fields.One2many( + related="budget_id.crossovered_budget_line_ids", string="Budget Lines" + ) + budget_state = fields.Selection( + related="budget_id.state", string="Budget Status" + ) diff --git a/project_budget/pyproject.toml b/project_budget/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/project_budget/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/project_budget/readme/CONTRIBUTORS.md b/project_budget/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..d22e93ab1b --- /dev/null +++ b/project_budget/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Patrick Wilson \ +- Maxime Chambreuil \ diff --git a/project_budget/readme/DESCRIPTION.md b/project_budget/readme/DESCRIPTION.md new file mode 100644 index 0000000000..071ad5a862 --- /dev/null +++ b/project_budget/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module integrates the OCA Account Budget with Project. + +Budgets can be created and viewed directly from the project without the +need for additional accounting access. diff --git a/project_budget/readme/USAGE.md b/project_budget/readme/USAGE.md new file mode 100644 index 0000000000..c89e4306f5 --- /dev/null +++ b/project_budget/readme/USAGE.md @@ -0,0 +1,5 @@ +To use this module, you need to: + +1. Have user rights for Project Budget viewer or manager group. +2. Open a project and view the Budget tab. +3. Create a new budget. The budget lines are visible on the project. diff --git a/project_budget/security/ir.model.access.csv b/project_budget/security/ir.model.access.csv new file mode 100644 index 0000000000..90f7beb744 --- /dev/null +++ b/project_budget/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_project_account_budget_post_internal,account_budget_post_internal,account_budget_oca.model_account_budget_post,project.group_project_user,1,0,0,0 +access_project_account_budget_internal,account_budget_internal,account_budget_oca.model_crossovered_budget,project.group_project_user,1,0,0,0 +access_project_account_budget_post_viewer,account_budget_post_viewer,account_budget_oca.model_account_budget_post,group_project_budget_viewer,1,0,0,0 +access_project_account_budget_manager,account_budget_manager,account_budget_oca.model_crossovered_budget,group_project_budget_manager,1,1,1,1 +access_project_account_move_line_manager,account_move_line_manager,account.model_account_move_line,group_project_budget_manager,1,0,0,0 diff --git a/project_budget/security/project_security.xml b/project_budget/security/project_security.xml new file mode 100644 index 0000000000..5320893533 --- /dev/null +++ b/project_budget/security/project_security.xml @@ -0,0 +1,20 @@ + + + + Project Budget + User access level for Project Budgets + 100 + + + Viewer + + + + + Manager + + + + + diff --git a/project_budget/static/description/icon.png b/project_budget/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/project_budget/static/description/icon.png differ diff --git a/project_budget/static/description/index.html b/project_budget/static/description/index.html new file mode 100644 index 0000000000..60c3e82995 --- /dev/null +++ b/project_budget/static/description/index.html @@ -0,0 +1,649 @@ + + + + + + Project Budget + + + +
+

Project Budget

+ + +

+ Beta + License: AGPL-3 + OCA/project + Translate me on Weblate + Try me on Runboat +

+

This module integrates the OCA Account Budget with Project.

+

+ Budgets can be created and viewed directly from the project without the need for additional accounting + access. +

+

Table of contents

+
+ +
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Have user rights for Project Budget viewer or manager group.
  2. +
  3. Open a project and view the Budget tab.
  4. +
  5. Create a new budget. The budget lines are visible on the project.
  6. +
+
+
+

Bug Tracker

+

+ Bugs are tracked on + GitHub 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. +

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Patrick Wilson
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ + Odoo Community Association + +

+ 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. +

+

+ Current + maintainer: +

+

+ patrickrwilson +

+

+ This module is part of the + OCA/project + project on GitHub. +

+

+ You are welcome to contribute. To learn how please visit + https://odoo-community.org/page/Contribute. +

+
+
+
+ + diff --git a/project_budget/views/account_budget.xml b/project_budget/views/account_budget.xml new file mode 100644 index 0000000000..042220781d --- /dev/null +++ b/project_budget/views/account_budget.xml @@ -0,0 +1,21 @@ + + + + project.account.budget.inherit.form + crossovered.budget + + form + + + + + + + + {'default_date_from': date_from,'default_date_to': date_to, 'default_analytic_account_id': analytic_account_id} + + + + + diff --git a/project_budget/views/project.xml b/project_budget/views/project.xml new file mode 100644 index 0000000000..76f0b12645 --- /dev/null +++ b/project_budget/views/project.xml @@ -0,0 +1,58 @@ + + + + project.budget.inherit.form + project.project + + form + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/project_budget/odoo/addons/project_budget b/setup/project_budget/odoo/addons/project_budget new file mode 120000 index 0000000000..559b4d4adc --- /dev/null +++ b/setup/project_budget/odoo/addons/project_budget @@ -0,0 +1 @@ +../../../../project_budget \ No newline at end of file diff --git a/setup/project_budget/setup.py b/setup/project_budget/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/project_budget/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)