From 0a7a9bc523e34409fca6021fd0f01a1a4db169a6 Mon Sep 17 00:00:00 2001 From: "Aung Ko Ko Lin (Quartile)" <45355704+AungKoKoLin1997@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:14:48 +0700 Subject: [PATCH] [3874][ADD] project_account_manager (#63) * [ADD] project_account_manager --- project_account_manager/README.rst | 55 +++ project_account_manager/__init__.py | 1 + project_account_manager/__manifest__.py | 14 + project_account_manager/models/__init__.py | 1 + .../models/project_project.py | 28 ++ project_account_manager/readme/DESCRIPTION.md | 1 + .../static/description/index.html | 409 ++++++++++++++++++ .../views/project_project_views.xml | 12 + .../odoo/addons/project_account_manager | 1 + setup/project_account_manager/setup.py | 6 + 10 files changed, 528 insertions(+) create mode 100644 project_account_manager/README.rst create mode 100644 project_account_manager/__init__.py create mode 100644 project_account_manager/__manifest__.py create mode 100644 project_account_manager/models/__init__.py create mode 100644 project_account_manager/models/project_project.py create mode 100644 project_account_manager/readme/DESCRIPTION.md create mode 100644 project_account_manager/static/description/index.html create mode 100644 project_account_manager/views/project_project_views.xml create mode 120000 setup/project_account_manager/odoo/addons/project_account_manager create mode 100644 setup/project_account_manager/setup.py diff --git a/project_account_manager/README.rst b/project_account_manager/README.rst new file mode 100644 index 00000000..20ccc7e9 --- /dev/null +++ b/project_account_manager/README.rst @@ -0,0 +1,55 @@ +======================= +Project Account Manager +======================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5f62e912cac1b13e15496b32a7f1a35fa6e11297cfaf85231e81ceee1316e9ff + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/project_account_manager + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +This module adds the account_manager_ids field to the project. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Quartile Limited + +Maintainers +----------- + +This module is part of the `qrtl/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/project_account_manager/__init__.py b/project_account_manager/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/project_account_manager/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_account_manager/__manifest__.py b/project_account_manager/__manifest__.py new file mode 100644 index 00000000..e6d76e73 --- /dev/null +++ b/project_account_manager/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2023 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Project Account Manager", + "version": "16.0.1.0.0", + "category": "project", + "website": "https://www.quartile.co", + "author": "Quartile Limited", + "license": "LGPL-3", + "depends": ["project"], + "data": [ + "views/project_project_views.xml", + ], +} diff --git a/project_account_manager/models/__init__.py b/project_account_manager/models/__init__.py new file mode 100644 index 00000000..56545d0d --- /dev/null +++ b/project_account_manager/models/__init__.py @@ -0,0 +1 @@ +from . import project_project diff --git a/project_account_manager/models/project_project.py b/project_account_manager/models/project_project.py new file mode 100644 index 00000000..a67728e8 --- /dev/null +++ b/project_account_manager/models/project_project.py @@ -0,0 +1,28 @@ +# Copyright 2023 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models + + +class ProjectProject(models.Model): + _inherit = "project.project" + + account_manager_ids = fields.Many2many("res.users") + + @api.model_create_multi + def create(self, vals_list): + projects = super(ProjectProject, self).create(vals_list) + for project in projects: + if project.account_manager_ids: + partner_ids = project.account_manager_ids.mapped("partner_id").ids + project.message_subscribe(partner_ids=partner_ids) + return projects + + def write(self, vals): + res = super(ProjectProject, self).write(vals) + if "account_manager_ids" in vals: + for project in self: + if project.account_manager_ids: + partner_ids = project.account_manager_ids.mapped("partner_id").ids + project.message_subscribe(partner_ids=partner_ids) + return res diff --git a/project_account_manager/readme/DESCRIPTION.md b/project_account_manager/readme/DESCRIPTION.md new file mode 100644 index 00000000..3719d291 --- /dev/null +++ b/project_account_manager/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds the account_manager_ids field to the project. diff --git a/project_account_manager/static/description/index.html b/project_account_manager/static/description/index.html new file mode 100644 index 00000000..e210d097 --- /dev/null +++ b/project_account_manager/static/description/index.html @@ -0,0 +1,409 @@ + + + + + + +Project Account Manager + + + +
+

Project Account Manager

+ + +

Beta License: LGPL-3 qrtl/axls-custom

+

This module adds the account_manager_ids field to the project.

+

Table of contents

+ +
+

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

+
    +
  • Quartile Limited
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/axls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/project_account_manager/views/project_project_views.xml b/project_account_manager/views/project_project_views.xml new file mode 100644 index 00000000..cba787c0 --- /dev/null +++ b/project_account_manager/views/project_project_views.xml @@ -0,0 +1,12 @@ + + + project.project.form.inherit + project.project + + + + + + + + diff --git a/setup/project_account_manager/odoo/addons/project_account_manager b/setup/project_account_manager/odoo/addons/project_account_manager new file mode 120000 index 00000000..a34865b4 --- /dev/null +++ b/setup/project_account_manager/odoo/addons/project_account_manager @@ -0,0 +1 @@ +../../../../project_account_manager \ No newline at end of file diff --git a/setup/project_account_manager/setup.py b/setup/project_account_manager/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/project_account_manager/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)