From 6fa4e5c05305c67c7774e306e1981e81bf14a142 Mon Sep 17 00:00:00 2001 From: mpascual Date: Fri, 20 Dec 2024 11:01:17 +0100 Subject: [PATCH] [ADD] mail_autosubscribe_partner_parent: New module mail_autosubscribe_partner_parent --- mail_autosubscribe_partner_parent/README.rst | 100 ++++ mail_autosubscribe_partner_parent/__init__.py | 1 + .../__manifest__.py | 13 + .../models/__init__.py | 1 + .../models/base.py | 12 + .../readme/CONTRIBUTORS.md | 2 + .../readme/DESCRIPTION.md | 1 + .../readme/USAGE.md | 7 + .../static/description/index.html | 439 ++++++++++++++++++ .../addons/mail_autosubscribe_partner_parent | 1 + .../setup.py | 6 + 11 files changed, 583 insertions(+) create mode 100644 mail_autosubscribe_partner_parent/README.rst create mode 100644 mail_autosubscribe_partner_parent/__init__.py create mode 100644 mail_autosubscribe_partner_parent/__manifest__.py create mode 100644 mail_autosubscribe_partner_parent/models/__init__.py create mode 100644 mail_autosubscribe_partner_parent/models/base.py create mode 100644 mail_autosubscribe_partner_parent/readme/CONTRIBUTORS.md create mode 100644 mail_autosubscribe_partner_parent/readme/DESCRIPTION.md create mode 100644 mail_autosubscribe_partner_parent/readme/USAGE.md create mode 100644 mail_autosubscribe_partner_parent/static/description/index.html create mode 120000 setup/mail_autosubscribe_partner_parent/odoo/addons/mail_autosubscribe_partner_parent create mode 100644 setup/mail_autosubscribe_partner_parent/setup.py diff --git a/mail_autosubscribe_partner_parent/README.rst b/mail_autosubscribe_partner_parent/README.rst new file mode 100644 index 0000000000..d2affdf044 --- /dev/null +++ b/mail_autosubscribe_partner_parent/README.rst @@ -0,0 +1,100 @@ +============================ +Autosubscribe Partner Parent +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6f0c9e80ca722a371969a9bc4d020480a6ffb2b15491bf45f1910d1dd024eadc + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/16.0/mail_autosubscribe_partner_parent + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_autosubscribe_partner_parent + :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/social&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends mail_autosubscribe functionality to add the partner +parent in copy of their child partner documents. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +When creating a selected autosubscribe record, it adds the partner +parent in copy of it. + +For example, if you have invoice selected on mail_autosubscribe_ids: + +Go to Invoicing > Create a new Invoice > Select the wanted partner > +Confirm the invoice + +The parent partner will be automatically added in copy of the invoice. + +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 +------- + +* Miquel Pascual + +Contributors +------------ + +- `APSL-Nagarro `__: + + - Miquel Pascual <> + +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-mpascuall| image:: https://github.com/mpascuall.png?size=40px + :target: https://github.com/mpascuall + :alt: mpascuall + +Current `maintainer `__: + +|maintainer-mpascuall| + +This module is part of the `OCA/social `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_autosubscribe_partner_parent/__init__.py b/mail_autosubscribe_partner_parent/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/mail_autosubscribe_partner_parent/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_autosubscribe_partner_parent/__manifest__.py b/mail_autosubscribe_partner_parent/__manifest__.py new file mode 100644 index 0000000000..26aea1fb06 --- /dev/null +++ b/mail_autosubscribe_partner_parent/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "Autosubscribe Partner Parent", + "version": "16.0.1.0.0", + "summary": """Autosubscribes the parent of the partner to the record followers""", + "category": "Marketing", + "license": "AGPL-3", + "author": """Miquel Pascual, Odoo Community Association (OCA)""", + "website": "https://github.com/OCA/social", + "depends": ["mail_autosubscribe", "base_partner_company_group"], + "installable": True, + "application": False, + "maintainers": ["mpascuall"], +} diff --git a/mail_autosubscribe_partner_parent/models/__init__.py b/mail_autosubscribe_partner_parent/models/__init__.py new file mode 100644 index 0000000000..0e44449338 --- /dev/null +++ b/mail_autosubscribe_partner_parent/models/__init__.py @@ -0,0 +1 @@ +from . import base diff --git a/mail_autosubscribe_partner_parent/models/base.py b/mail_autosubscribe_partner_parent/models/base.py new file mode 100644 index 0000000000..0f53e84ad5 --- /dev/null +++ b/mail_autosubscribe_partner_parent/models/base.py @@ -0,0 +1,12 @@ +from odoo import api, models + + +class BaseModel(models.AbstractModel): + _inherit = "base" + + @api.model + def _message_get_autosubscribe_followers(self, partners): + domain = self._message_get_autosubscribe_followers_domain(partners) + partners = self.env["res.partner"].sudo().search(domain) + partners_with_parent = partners + (partners.mapped("parent_id")) + return partners_with_parent diff --git a/mail_autosubscribe_partner_parent/readme/CONTRIBUTORS.md b/mail_autosubscribe_partner_parent/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..968156fa1a --- /dev/null +++ b/mail_autosubscribe_partner_parent/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [APSL-Nagarro](): + - Miquel Pascual \<\<\>\> \ No newline at end of file diff --git a/mail_autosubscribe_partner_parent/readme/DESCRIPTION.md b/mail_autosubscribe_partner_parent/readme/DESCRIPTION.md new file mode 100644 index 0000000000..2f82b23e69 --- /dev/null +++ b/mail_autosubscribe_partner_parent/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module extends mail_autosubscribe functionality to add the partner parent in copy of their child partner documents. \ No newline at end of file diff --git a/mail_autosubscribe_partner_parent/readme/USAGE.md b/mail_autosubscribe_partner_parent/readme/USAGE.md new file mode 100644 index 0000000000..382bd437c6 --- /dev/null +++ b/mail_autosubscribe_partner_parent/readme/USAGE.md @@ -0,0 +1,7 @@ +When creating a selected autosubscribe record, it adds the partner parent in copy of it. + +For example, if you have invoice selected on mail_autosubscribe_ids: + +Go to Invoicing > Create a new Invoice > Select the wanted partner > Confirm the invoice + +The parent partner will be automatically added in copy of the invoice. \ No newline at end of file diff --git a/mail_autosubscribe_partner_parent/static/description/index.html b/mail_autosubscribe_partner_parent/static/description/index.html new file mode 100644 index 0000000000..1755cd953a --- /dev/null +++ b/mail_autosubscribe_partner_parent/static/description/index.html @@ -0,0 +1,439 @@ + + + + + +Autosubscribe Partner Parent + + + +
+

Autosubscribe Partner Parent

+ + +

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

+

This module extends mail_autosubscribe functionality to add the partner +parent in copy of their child partner documents.

+

Table of contents

+ +
+

Usage

+

When creating a selected autosubscribe record, it adds the partner +parent in copy of it.

+

For example, if you have invoice selected on mail_autosubscribe_ids:

+

Go to Invoicing > Create a new Invoice > Select the wanted partner > +Confirm the invoice

+

The parent partner will be automatically added in copy of the invoice.

+
+
+

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

+
    +
  • Miquel Pascual
  • +
+
+
+

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:

+

mpascuall

+

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

+

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

+
+
+
+ + diff --git a/setup/mail_autosubscribe_partner_parent/odoo/addons/mail_autosubscribe_partner_parent b/setup/mail_autosubscribe_partner_parent/odoo/addons/mail_autosubscribe_partner_parent new file mode 120000 index 0000000000..fe65d822d5 --- /dev/null +++ b/setup/mail_autosubscribe_partner_parent/odoo/addons/mail_autosubscribe_partner_parent @@ -0,0 +1 @@ +../../../../mail_autosubscribe_partner_parent \ No newline at end of file diff --git a/setup/mail_autosubscribe_partner_parent/setup.py b/setup/mail_autosubscribe_partner_parent/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/mail_autosubscribe_partner_parent/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)