Skip to content
Merged
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
4 changes: 1 addition & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ odoo_test_flavor: Both
odoo_version: 16.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups:
- account_invoice_triple_discount,account_invoice_supplierinfo_update_triple_discount
- account_invoice_fixed_discount
rebel_module_groups: []
repo_description: 'TODO: add repo description.'
repo_name: account-invoicing
repo_slug: account-invoicing
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,8 @@ jobs:
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
include: "account_invoice_triple_discount,account_invoice_supplierinfo_update_triple_discount"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
include: "account_invoice_triple_discount,account_invoice_supplierinfo_update_triple_discount"
name: test with OCB
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
include: "account_invoice_fixed_discount"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
include: "account_invoice_fixed_discount"
name: test with OCB
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
exclude: "account_invoice_triple_discount,account_invoice_supplierinfo_update_triple_discount,account_invoice_fixed_discount"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
exclude: "account_invoice_triple_discount,account_invoice_supplierinfo_update_triple_discount,account_invoice_fixed_discount"
name: test with OCB
makepot: "true"
services:
Expand All @@ -65,9 +49,6 @@ jobs:
POSTGRES_DB: odoo
ports:
- 5432:5432
env:
INCLUDE: "${{ matrix.include }}"
EXCLUDE: "${{ matrix.exclude }}"
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ addon | version | maintainers | summary
[account_invoice_discount_display_amount](account_invoice_discount_display_amount/) | 16.0.1.1.2 | | Show total discount applied and total without discount on invoices.
[account_invoice_fiscal_position_update](account_invoice_fiscal_position_update/) | 16.0.1.0.2 | <a href='https://github.com/alexis-via'><img src='https://github.com/alexis-via.png' width='32' height='32' style='border-radius:50%;' alt='alexis-via'/></a> | Changing the fiscal position of an invoice will auto-update invoice lines
[account_invoice_fixed_discount](account_invoice_fixed_discount/) | 16.0.2.0.0 | | Allows to apply fixed amount discounts in invoices.
[account_invoice_fixed_triple_discount](account_invoice_fixed_triple_discount/) | 16.0.1.0.0 | | Compatibility between fixed and triple discount modules
[account_invoice_force_number](account_invoice_force_number/) | 16.0.1.0.1 | | Allows to force invoice numbering on specific invoices
[account_invoice_google_document_ai](account_invoice_google_document_ai/) | 16.0.1.0.0 | | Allows to import data from document using Google Document AI
[account_invoice_line_default_account](account_invoice_line_default_account/) | 16.0.1.0.0 | | Account Invoice Line Default Account
Expand Down
8 changes: 7 additions & 1 deletion account_invoice_fixed_discount/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Account Fixed Discount
======================
Expand All @@ -13,7 +17,7 @@ Account Fixed Discount
.. |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
.. |badge2| image:: https://img.shields.io/badge/license-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%2Faccount--invoicing-lightgray.png?logo=github
Expand All @@ -33,6 +37,8 @@ amount discounts at invoice line level.

The module also extends the invoice report to show fixed discount.

If the module `account_invoice_triple_discount` is installed and a fixed discount is set, it will take priority over anything set in the triple discount fields.

**Table of contents**

.. contents::
Expand Down
1 change: 0 additions & 1 deletion account_invoice_fixed_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"application": False,
"installable": True,
"depends": ["account"],
"excludes": ["account_invoice_triple_discount"],
"data": [
"security/res_groups.xml",
"views/account_move_view.xml",
Expand Down
2 changes: 2 additions & 0 deletions account_invoice_fixed_discount/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ This module extends the functionality of Invoicing to allow you to apply fixed
amount discounts at invoice line level.

The module also extends the invoice report to show fixed discount.

If the module `account_invoice_triple_discount` is installed and a fixed discount is set, it will take priority over anything set in the triple discount fields.
29 changes: 20 additions & 9 deletions account_invoice_fixed_discount/reports/report_account_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,36 @@
t-value="any([l.discount_fixed for l in o.invoice_line_ids])"
/>
</xpath>
<xpath expr="//th[@t-if='display_discount']/span" position="attributes">
<attribute name="t-if">not display_discount_fixed</attribute>
<xpath expr="//th[@name='th_price_unit']" position="attributes">
<attribute name="t-if" add="display_discount_fixed" separator=" or " />
</xpath>
<xpath expr="//th[@name='th_price_unit']/span" position="attributes">
<attribute name="t-if" add="not display_discount_fixed" separator=" or " />
</xpath>

<xpath expr="//th[@t-if='display_discount']/span" position="before">
<xpath expr="//th[@name='th_price_unit']/span" position="before">
<t t-if="display_discount_fixed">
<span>Discount Amount (%)</span>
</t>
</xpath>

<span t-field="line.discount" position="before">
<t t-if="display_discount_fixed">
<xpath expr="//span[@t-field='line.discount']/.." position="attributes">
<attribute name="t-if" add="display_discount_fixed" separator=" or " />
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="attributes">
<attribute name="t-if" add="line.discount_fixed" separator=" or " />
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="before">
<t t-if="display_discount_fixed and line.discount_fixed">
<span class="text-nowrap" t-field="line.discount_fixed" /><span
class="text-nowrap"
> (or</span>
</t>
</span>
<span t-field="line.discount" position="after">
<t t-if="display_discount_fixed"><span class="text-nowrap"> %)</span></t>
</span>
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="after">
<t t-if="display_discount_fixed and line.discount_fixed"><span
class="text-nowrap"
> %)</span></t>
</xpath>
</template>
</odoo>
29 changes: 18 additions & 11 deletions account_invoice_fixed_discount/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Account Fixed Discount</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,19 +360,25 @@
</style>
</head>
<body>
<div class="document" id="account-fixed-discount">
<h1 class="title">Account Fixed Discount</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="account-fixed-discount">
<h1>Account Fixed Discount</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9888c4df69bac53c42cd1ea2d99cdbd559258cf8fa888b0547e7fe0fcaa949d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_fixed_discount"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_fixed_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_fixed_discount"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_fixed_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Invoicing to allow you to apply fixed
amount discounts at invoice line level.</p>
<p>The module also extends the invoice report to show fixed discount.</p>
<p>If the module <cite>account_invoice_triple_discount</cite> is installed and a fixed discount is set, it will take priority over anything set in the triple discount fields.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -388,12 +394,12 @@ <h1 class="title">Account Fixed Discount</h1>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
<p><strong>Warning</strong>: This module is incompatible with
<tt class="docutils literal">account_invoice_triple_discount</tt> which also belongs to <a class="reference external" href="https://github.com/OCA/account-invoicing">OCA/account-invoicing</a>.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <em>Settings</em> and <em>Activate the developer mode</em></li>
Expand All @@ -402,23 +408,23 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_fixed_discount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
<ul class="simple">
<li>ForgeFlow</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
<ul class="simple">
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
Expand All @@ -428,7 +434,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -441,5 +447,6 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def test_01_discounts_fixed_single_unit(self):
# Force the fixed discount as the onchange does not
# handle the context properly
line.discount_fixed = 0.0
line.discount = 20.0

self.invoice.invoice_line_ids[0].discount = 20.0
self.assertEqual(self.invoice.invoice_line_ids.discount_fixed, 0.0)
self.assertEqual(self.invoice.invoice_line_ids.discount, 20.0)
self.assertEqual(self.invoice.amount_total, 176.0)
Expand Down
76 changes: 76 additions & 0 deletions account_invoice_fixed_triple_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============================
Account Fixed Triple Discount
=============================

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

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

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

Glue module between `account_invoice_fixed_discount` and `account_invoice_triple_discount`.
When both are used on the same line a warning will appear to alert the user that the fixed discount will take priority and it's recommended to only use one.

**Table of contents**

.. contents::
:local:

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

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

Contributors
~~~~~~~~~~~~

* Ethan Hildick <hildickethan@gmail.com>

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/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_fixed_triple_discount>`_ 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 account_invoice_fixed_triple_discount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions account_invoice_fixed_triple_discount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Ethan Hildick
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Fixed Triple Discount",
"summary": "Compatibility between fixed and triple discount modules",
"version": "16.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-invoicing",
"author": "Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["account_invoice_fixed_discount", "account_invoice_triple_discount"],
"auto_install": True,
"data": ["views/account_move_view.xml"],
}
Loading