diff --git a/contract_line_invoice_by_average/README.rst b/contract_line_invoice_by_average/README.rst new file mode 100644 index 00000000..f98aa279 --- /dev/null +++ b/contract_line_invoice_by_average/README.rst @@ -0,0 +1,88 @@ +================================ +Contract Line Invoice By Average +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/contract_line_invoice_by_average + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_line_invoice_by_average + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to define products on a contract that needs to be invoiced by the average quantity instead of the sum. + +For example, you may have a contract for 3 water dispensers and have 4 sales orders in a month for a total of 15 bottles of water. Your invoice would be: + + * 3 water dispensers + * 5 bottles + + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Sales +* Create sales orders with the products invoiced by average quantity (bottle of water) and the same contract +* When the invoice is created, the quantity of the invoice line is not the sum of the sale order lines, but the average by the quantity on the contract line. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators +* Serpent Consulting Services Pvt. Ltd. + +Contributors +~~~~~~~~~~~~ + +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. + +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/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_line_invoice_by_average/__init__.py b/contract_line_invoice_by_average/__init__.py new file mode 100644 index 00000000..7b945476 --- /dev/null +++ b/contract_line_invoice_by_average/__init__.py @@ -0,0 +1,3 @@ + # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/contract_line_invoice_by_average/__manifest__.py b/contract_line_invoice_by_average/__manifest__.py new file mode 100644 index 00000000..3c80b3b7 --- /dev/null +++ b/contract_line_invoice_by_average/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2019 Open Source Integrators +# Copyright (C) 2019 Serpent Consulting Services +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + 'name': 'Contract Line Invoice By Average', + 'version': '12.0.1.0.0', + 'category': 'Contract', + 'summary': "Contract Line Invoice By Average.", + 'author': 'Open Source Integrators, ' + 'Serpent Consulting Services Pvt. Ltd.,' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/oca/contract', + 'depends': [ + 'account_invoice_pricelist', + 'contract_sale_invoicing', + 'product_contract' + ], + 'data': [ + 'views/contract_line_view.xml', + ], + 'license': 'AGPL-3', + 'installable': True, +} diff --git a/contract_line_invoice_by_average/models/__init__.py b/contract_line_invoice_by_average/models/__init__.py new file mode 100644 index 00000000..ecc2efb3 --- /dev/null +++ b/contract_line_invoice_by_average/models/__init__.py @@ -0,0 +1,3 @@ + # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import contract_line diff --git a/contract_line_invoice_by_average/models/contract_line.py b/contract_line_invoice_by_average/models/contract_line.py new file mode 100644 index 00000000..20b8f1d1 --- /dev/null +++ b/contract_line_invoice_by_average/models/contract_line.py @@ -0,0 +1,14 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ContractLine(models.AbstractModel): + _inherit = 'contract.abstract.contract.line' + + products_invoiced_by_avg_ids = fields.Many2many( + comodel_name='product.product', + relation='contract_line_product_id_rel', + column1='contract_line_id', + column2='product_id', + string='Products Invoiced using Average Quantity') diff --git a/contract_line_invoice_by_average/readme/CONFIGURATION.rst b/contract_line_invoice_by_average/readme/CONFIGURATION.rst new file mode 100644 index 00000000..89b5a6df --- /dev/null +++ b/contract_line_invoice_by_average/readme/CONFIGURATION.rst @@ -0,0 +1,4 @@ +* Go to Invoicing > Customers > Contracts +* Select or create a contract with a line +* Select the product (Dispenser), the quantity (3) and the products invoiced by average quantity (Bottle of water). + diff --git a/contract_line_invoice_by_average/readme/CONTRIBUTORS.rst b/contract_line_invoice_by_average/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..64881b41 --- /dev/null +++ b/contract_line_invoice_by_average/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. diff --git a/contract_line_invoice_by_average/readme/DESCRIPTION.rst b/contract_line_invoice_by_average/readme/DESCRIPTION.rst new file mode 100644 index 00000000..f7cea0c0 --- /dev/null +++ b/contract_line_invoice_by_average/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module allows you to define products on a contract that needs to be invoiced by the average quantity instead of the sum. + +For example, you may have a contract for 3 water dispensers and have 4 sales orders in a month for a total of 15 bottles of water. Your invoice would be: + + * 3 water dispensers + * 5 bottles + diff --git a/contract_line_invoice_by_average/readme/USAGE.rst b/contract_line_invoice_by_average/readme/USAGE.rst new file mode 100644 index 00000000..be1410c1 --- /dev/null +++ b/contract_line_invoice_by_average/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to Sales +* Create sales orders with the products invoiced by average quantity (bottle of water) and the same contract +* When the invoice is created, the quantity of the invoice line is not the sum of the sale order lines, but the average by the quantity on the contract line. diff --git a/contract_line_invoice_by_average/static/description/icon.png b/contract_line_invoice_by_average/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/contract_line_invoice_by_average/static/description/icon.png differ diff --git a/contract_line_invoice_by_average/static/description/index.html b/contract_line_invoice_by_average/static/description/index.html new file mode 100644 index 00000000..0d91e975 --- /dev/null +++ b/contract_line_invoice_by_average/static/description/index.html @@ -0,0 +1,437 @@ + + + + + + +Contract Line Invoice By Average + + + +
+

Contract Line Invoice By Average

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

This module allows you to define products on a contract that needs to be invoiced by the average quantity instead of the sum.

+

For example, you may have a contract for 3 water dispensers and have 4 sales orders in a month for a total of 15 bottles of water. Your invoice would be:

+
+
    +
  • 3 water dispensers
  • +
  • 5 bottles
  • +
+
+

Table of contents

+ +
+

Usage

+
    +
  • Go to Sales
  • +
  • Create sales orders with the products invoiced by average quantity (bottle of water) and the same contract
  • +
  • When the invoice is created, the quantity of the invoice line is not the sum of the sale order lines, but the average by the quantity on the contract line.
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
  • Serpent Consulting Services Pvt. Ltd.
  • +
+
+
+

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.

+

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

+

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

+
+
+
+ + diff --git a/contract_line_invoice_by_average/views/contract_line_view.xml b/contract_line_invoice_by_average/views/contract_line_view.xml new file mode 100644 index 00000000..37104aed --- /dev/null +++ b/contract_line_invoice_by_average/views/contract_line_view.xml @@ -0,0 +1,14 @@ + + + + inherit.contract.line.form.view + contract.abstract.contract.line + + + + + + + + + diff --git a/oca_dependencies.txt b/oca_dependencies.txt index d7f9e901..21eb6fed 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,3 +1,4 @@ bank-payment queue +account-invoicing