Skip to content

Commit

Permalink
[17.0][ADD] agreement_sale_account
Browse files Browse the repository at this point in the history
  • Loading branch information
ilo committed Nov 19, 2024
1 parent da6eaa8 commit 045c1d1
Show file tree
Hide file tree
Showing 12 changed files with 608 additions and 0 deletions.
93 changes: 93 additions & 0 deletions agreement_sale_account/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
======================
Agreement Sale Account
======================

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

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

This module allow to propagate the ``agreement_id`` from the sale order
to the invoice. This is useful when you want to use an agreement in the
sale order and you want to keep the same agreement in the invoice.

**Table of contents**

.. contents::
:local:

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

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

* Camptocamp SA
* Italo Lopes

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

- Italo LOPES <[email protected]>

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-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via
.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px
:target: https://github.com/bealdav
:alt: bealdav
.. |maintainer-imlopes| image:: https://github.com/imlopes.png?size=40px
:target: https://github.com/imlopes
:alt: imlopes

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

|maintainer-alexis-via| |maintainer-bealdav| |maintainer-imlopes|

This module is part of the `OCA/agreement <https://github.com/OCA/agreement/tree/17.0/agreement_sale_account>`_ 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 agreement_sale_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions agreement_sale_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# © 2017 Akretion (Alexis de Lattre <[email protected]>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Agreement Sale Account",
"summary": "Bridge between sales and account",
"version": "17.0.1.0.0",
"category": "Contract",
"author": "Camptocamp SA, Italo Lopes, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/agreement",
"license": "AGPL-3",
"depends": ["agreement_account", "agreement_sale"],
"data": [],
"development_status": "Beta",
"maintainers": ["alexis-via", "bealdav", "imlopes"],
"installable": True,
}
1 change: 1 addition & 0 deletions agreement_sale_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale
16 changes: 16 additions & 0 deletions agreement_sale_account/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Camptocamp SA (https://www.camptocamp.com).
# @author: Italo Lopes <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import models


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

def _prepare_invoice(self):
res = super()._prepare_invoice()
if self.agreement_id:
res["agreement_id"] = self.agreement_id.id
return res
3 changes: 3 additions & 0 deletions agreement_sale_account/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions agreement_sale_account/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Italo LOPES \<<[email protected]>\>
3 changes: 3 additions & 0 deletions agreement_sale_account/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module allow to propagate the ``agreement_id`` from the sale order to the invoice.
This is useful when you want to use an agreement in the sale order and you want to keep
the same agreement in the invoice.
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 045c1d1

Please sign in to comment.