Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/subscription_analytic_project/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
82 changes: 82 additions & 0 deletions subscription_analytic_project/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
=============================
Subscription Analytic Project
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cd2eb920a17ef326e33d3b184d0e6687de96a04539245781796a1b0b411f2fe5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/16.0/subscription_analytic_project
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-subscription_analytic_project
: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/contract&target_branch=16.0
:alt: Try me on Runboat

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

This module extends the subscription functionality to integrate with project management.

When a subscription line is created from a sale order line that has an associated project,
this module automatically updates the analytic distribution to use the project's analytic account.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/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/contract/issues/new?body=module:%20subscription_analytic_project%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
~~~~~~~

* Innovyou

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-LorenzoC0| image:: https://github.com/LorenzoC0.png?size=40px
:target: https://github.com/LorenzoC0
:alt: LorenzoC0

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-LorenzoC0|

This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/16.0/subscription_analytic_project>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions subscription_analytic_project/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions subscription_analytic_project/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 Innovyou - Lorenzo Carta
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Subscription Analytic Project",
"summary": "Link subscription lines to project analytic accounts",
"version": "16.0.1.0.0",
"category": "Hidden",
"website": "https://github.com/OCA/contract",
"author": "Innovyou, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["subscription_oca", "sale_project"],
"installable": True,
"auto_install": True,
"maintainers": ["LorenzoC0"],
}
1 change: 1 addition & 0 deletions subscription_analytic_project/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order_line
16 changes: 16 additions & 0 deletions subscription_analytic_project/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from odoo import models


class SaleSubscription(models.Model):
_inherit = "sale.order.line"

def get_subscription_line_values(self):
res = super().get_subscription_line_values()

Check warning on line 8 in subscription_analytic_project/models/sale_order_line.py

View check run for this annotation

Codecov / codecov/patch

subscription_analytic_project/models/sale_order_line.py#L8

Added line #L8 was not covered by tests

if not res["analytic_distribution"]:
if self.project_id.analytic_account_id:
res["analytic_distribution"] = {

Check warning on line 12 in subscription_analytic_project/models/sale_order_line.py

View check run for this annotation

Codecov / codecov/patch

subscription_analytic_project/models/sale_order_line.py#L12

Added line #L12 was not covered by tests
self.project_id.analytic_account_id.id: 100.0
}

return res

Check warning on line 16 in subscription_analytic_project/models/sale_order_line.py

View check run for this annotation

Codecov / codecov/patch

subscription_analytic_project/models/sale_order_line.py#L16

Added line #L16 was not covered by tests
4 changes: 4 additions & 0 deletions subscription_analytic_project/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module extends the subscription functionality to integrate with project management.

When a subscription line is created from a sale order line that has an associated project,
this module automatically updates the analytic distribution to use the project's analytic account.
Loading