-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3874][ADD] project_account_manager (#63)
* [ADD] project_account_manager
- Loading branch information
1 parent
e37eeb6
commit 0a7a9bc
Showing
10 changed files
with
528 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,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 <https://github.com/qrtl/axls-custom/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/qrtl/axls-custom/issues/new?body=module:%20project_account_manager%0Aversion:%2016.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 | ||
------- | ||
|
||
* Quartile Limited | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is part of the `qrtl/axls-custom <https://github.com/qrtl/axls-custom/tree/16.0/project_account_manager>`_ project on GitHub. | ||
|
||
You are welcome to 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 @@ | ||
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 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", | ||
], | ||
} |
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 project_project |
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,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 |
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 @@ | ||
This module adds the account_manager_ids field to the project. |
Oops, something went wrong.