Skip to content

Commit

Permalink
[ADD]sale_invoice_disable_salesperson_autosubscribe: disables salespe…
Browse files Browse the repository at this point in the history
…rson autosubscription when creating invoices.
  • Loading branch information
Roger committed Aug 30, 2024
1 parent 4b313a1 commit 4ab9bef
Show file tree
Hide file tree
Showing 14 changed files with 679 additions and 0 deletions.
89 changes: 89 additions & 0 deletions sale_invoice_disable_salesperson_autosubscribe/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
==============================================
Sale Invoice Disable Salesperson Autosubscribe
==============================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:81dc1a25d85f4d98c4657553af4d3a606cb37afdc2daa19a336a8fac6f281f23
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/17.0/sale_invoice_disable_salesperson_autosubscribe
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_invoice_disable_salesperson_autosubscribe
: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/sale-workflow&target_branch=17.0
:alt: Try me on Runboat

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

This module disables salesperson autosubscription when creating
invoices.

**Table of contents**

.. contents::
:local:

Installation
============

Just install

Usage
=====

Just install

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

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

* Sygel

Contributors
------------

- Harald Panten <harald.panten@sygel.es>
- Valentín Vinagre <valentin.vinagre@sygel.es>
- Roger Sans <roger.sans@sygel.es>

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/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_invoice_disable_salesperson_autosubscribe>`_ 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 sale_invoice_disable_salesperson_autosubscribe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions sale_invoice_disable_salesperson_autosubscribe/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Invoice Disable Salesperson Autosubscribe",
"version": "17.0.1.0.0",
"author": "Sygel, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Sales",
"summary": "This module disables salesperson autosubscription "
"when creating invoices.",
"website": "https://github.com/OCA/sale-workflow",
"depends": [
"sale",
],
"data": [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import account_move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class AccountMove(models.Model):
_inherit = "account.move"

@api.model_create_multi
def create(self, vals):
res = super().create(vals)
if self._context.get("active_model") == "sale.order" or not self._context.get(
"active_model"
):
if res.user_id:
res.message_unsubscribe([res.user_id.partner_id.id])
return res
3 changes: 3 additions & 0 deletions sale_invoice_disable_salesperson_autosubscribe/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Harald Panten \<<harald.panten@sygel.es>\>
- Valentín Vinagre \<<valentin.vinagre@sygel.es>\>
- Roger Sans \<<roger.sans@sygel.es>\>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module disables salesperson autosubscription when creating invoices.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Just install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Just install
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4ab9bef

Please sign in to comment.