diff --git a/oca_dependencies.txt b/oca_dependencies.txt index d9e0cd6649d..eb3eb63a286 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,3 +1,4 @@ +account-invoicing server-tools product-attribute server-ux diff --git a/purchase_triple_discount/README.rst b/purchase_triple_discount/README.rst index 4f88069330e..95174453e3e 100644 --- a/purchase_triple_discount/README.rst +++ b/purchase_triple_discount/README.rst @@ -1,14 +1,38 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -======================== -Purchase Triple Discount -======================== +=============================== +Account Invoice Triple Discount +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fpurchase--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-workflow/tree/11.0/purchase_triple_discount + :alt: OCA/purchase-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-workflow-11-0/purchase-workflow-11-0-purchase_triple_discount + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/142/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to have three successive discounts on every purchase order line. +**Table of contents** + +.. contents:: + :local: + Usage ===== @@ -30,47 +54,49 @@ Unit price: 600.00 -> - Disc. 1 = 50% -> Amount = 300.00 - Disc. 2 = -5% -> Amount = 315.00 -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/142/10.0 +Known issues / Roadmap +====================== + +* Include second and third discount in purchase order report. 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 smash it by providing detailed and welcomed feedback. +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 `_. -Known issues / Roadmap -====================== - -* Include second and third discount in purchase order report. +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Tecnativa Contributors ------------- +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * David Vidal -* David Vidal +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/purchase-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_triple_discount/__init__.py b/purchase_triple_discount/__init__.py index cde864bae21..0650744f6bc 100644 --- a/purchase_triple_discount/__init__.py +++ b/purchase_triple_discount/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import models diff --git a/purchase_triple_discount/__manifest__.py b/purchase_triple_discount/__manifest__.py index 7736ff5f17d..1a0835f6e5c 100644 --- a/purchase_triple_discount/__manifest__.py +++ b/purchase_triple_discount/__manifest__.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Account Invoice Triple Discount', - 'version': '10.0.1.1.0', + 'version': '11.0.1.0.0', 'category': 'Purchase Management', 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', - 'website': 'https://tecnativa.com', + 'website': 'https://github.com/OCA/purchase-workflow', 'license': 'AGPL-3', 'summary': 'Manage triple discount on purchase order lines', 'depends': [ diff --git a/purchase_triple_discount/models/__init__.py b/purchase_triple_discount/models/__init__.py index c72976ae1ea..a72e5d99c59 100644 --- a/purchase_triple_discount/models/__init__.py +++ b/purchase_triple_discount/models/__init__.py @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - from . import account_invoice from . import purchase_order diff --git a/purchase_triple_discount/models/account_invoice.py b/purchase_triple_discount/models/account_invoice.py index 18cb43c3a37..8c2e650addd 100644 --- a/purchase_triple_discount/models/account_invoice.py +++ b/purchase_triple_discount/models/account_invoice.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/purchase_triple_discount/models/purchase_order.py b/purchase_triple_discount/models/purchase_order.py index c2b2d363952..49291c4a8fc 100644 --- a/purchase_triple_discount/models/purchase_order.py +++ b/purchase_triple_discount/models/purchase_order.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -16,13 +15,11 @@ def _compute_amount(self): discount2 = fields.Float( 'Disc. 2 (%)', digits=dp.get_precision('Discount'), - default=0.0, ) discount3 = fields.Float( 'Disc. 3 (%)', digits=dp.get_precision('Discount'), - default=0.0, ) _sql_constraints = [ diff --git a/purchase_triple_discount/readme/CONTRIBUTORS.rst b/purchase_triple_discount/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..0ff1feb5358 --- /dev/null +++ b/purchase_triple_discount/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `_: + + * David Vidal diff --git a/purchase_triple_discount/readme/DESCRIPTION.rst b/purchase_triple_discount/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..1e65e34ddb3 --- /dev/null +++ b/purchase_triple_discount/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows to have three successive discounts on every purchase order +line. diff --git a/purchase_triple_discount/readme/ROADMAP.rst b/purchase_triple_discount/readme/ROADMAP.rst new file mode 100644 index 00000000000..9747b4c7b17 --- /dev/null +++ b/purchase_triple_discount/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Include second and third discount in purchase order report. diff --git a/purchase_triple_discount/readme/USAGE.rst b/purchase_triple_discount/readme/USAGE.rst new file mode 100644 index 00000000000..9a1f8b35393 --- /dev/null +++ b/purchase_triple_discount/readme/USAGE.rst @@ -0,0 +1,17 @@ +Create a new purchase order and add discounts in any of the three discount +fields given. They go in order of precedence so discount 2 will be calculated +over discount 1 and discount 3 over the result of discount 2. For example, +let's divide by two on every discount: + +Unit price: 600.00 -> + + - Disc. 1 = 50% -> Amount = 300.00 + - Disc. 2 = 50% -> Amount = 150.00 + - Disc. 3 = 50% -> Amount = 75.00 + +You can also use negative values to charge instead of discount: + +Unit price: 600.00 -> + + - Disc. 1 = 50% -> Amount = 300.00 + - Disc. 2 = -5% -> Amount = 315.00 diff --git a/purchase_triple_discount/static/description/index.html b/purchase_triple_discount/static/description/index.html new file mode 100644 index 00000000000..bec7fb614bc --- /dev/null +++ b/purchase_triple_discount/static/description/index.html @@ -0,0 +1,457 @@ + + + + + + +Account Invoice Triple Discount + + + +
+

Account Invoice Triple Discount

+ + +

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

+

This module allows to have three successive discounts on every purchase order +line.

+

Table of contents

+ +
+

Usage

+

Create a new purchase order and add discounts in any of the three discount +fields given. They go in order of precedence so discount 2 will be calculated +over discount 1 and discount 3 over the result of discount 2. For example, +let’s divide by two on every discount:

+

Unit price: 600.00 ->

+
+
    +
  • Disc. 1 = 50% -> Amount = 300.00
  • +
  • Disc. 2 = 50% -> Amount = 150.00
  • +
  • Disc. 3 = 50% -> Amount = 75.00
  • +
+
+

You can also use negative values to charge instead of discount:

+

Unit price: 600.00 ->

+
+
    +
  • Disc. 1 = 50% -> Amount = 300.00
  • +
  • Disc. 2 = -5% -> Amount = 315.00
  • +
+
+
+
+

Known issues / Roadmap

+
    +
  • Include second and third discount in purchase order report.
  • +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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/purchase-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/purchase_triple_discount/tests/__init__.py b/purchase_triple_discount/tests/__init__.py index b8e666681b0..19588b827ca 100644 --- a/purchase_triple_discount/tests/__init__.py +++ b/purchase_triple_discount/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_purchase_discount diff --git a/purchase_triple_discount/tests/test_purchase_discount.py b/purchase_triple_discount/tests/test_purchase_discount.py index ac4f0b3e73d..a77921c1d5a 100644 --- a/purchase_triple_discount/tests/test_purchase_discount.py +++ b/purchase_triple_discount/tests/test_purchase_discount.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).