Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0f543a3
[ADD] sale_global_discount: New module
chienandalu Apr 6, 2020
0cf3a05
Translated using Weblate (Spanish)
chienandalu Apr 30, 2020
15de030
[FIX] sale_global_discount: wrong property name
chienandalu Jun 30, 2020
1c192e0
[FIX] sale_global_discount: Constraint tax lines combinations
pedrobaeza Jul 3, 2020
aa25d30
[MIG] sale_global_discount: Migration to 12.0
pedrobaeza Jul 20, 2020
cfcdfc4
Added translation using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
0cc7ec0
Translated using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
49f3dd8
Translated using Weblate (Portuguese)
pedrocs-exo Sep 17, 2020
0264031
[FIX] sale_global_discount: Proper amount_by_group results
pedrobaeza Oct 9, 2020
83f9ddc
[FIX][12.0] sale_global_discount: sale order templates compatibility
pedrocs-exo Oct 13, 2020
a93fc74
sale_global_discount 12.0.1.0.2
OCA-git-bot Oct 15, 2020
2d2e04a
[IMP] sale_global_discount security
chienandalu Dec 11, 2020
e19049d
sale_global_discount 12.0.1.1.0
OCA-git-bot Dec 15, 2020
865c0c3
[FIX] sale_global_discount: duplicated label warning
chienandalu Dec 22, 2020
0c4862b
sale_global_discount 12.0.1.2.0
OCA-git-bot Dec 23, 2020
e97dd90
Translated using Weblate (Portuguese)
pedrocs-exo Jan 5, 2021
0b29b07
Translated using Weblate (Spanish)
danimv5 Mar 10, 2021
4d35a97
[IMP] sale_global_discount: black, isort, prettier
chienandalu Apr 19, 2021
c56492d
[MIG] sale_global_discount: Migration to 13.0
chienandalu Apr 20, 2021
b0ae054
[IMP] sale_global_discount: Remove dead code
pedrobaeza Jul 19, 2021
7dda368
[FIX] sale_global_discount: Create pricelist to use in partners in te…
victoralmau Jul 19, 2021
fc56c43
sale_global_discount 13.0.1.0.2
OCA-git-bot Jul 20, 2021
eac7e68
[MIG] sale_global_discount: Migration to 14.0
omar7r Aug 23, 2021
7ea175a
[FIX] sale_global_discount: computed fields must be stored because th…
omar7r Dec 21, 2021
422c41f
[FIX] sale_global_discount: Filtering global discount in on_change by…
omar7r Dec 21, 2021
14e3186
[FIX] sale_global_discount: Tests
omar7r Feb 22, 2022
fbbef90
[UPD] Update sale_global_discount.pot
oca-travis Mar 1, 2022
04b40e4
Added translation using Weblate (Italian)
francesco-ooops Mar 2, 2022
25570cf
Translated using Weblate (Italian)
francesco-ooops Mar 2, 2022
bcebeaf
[IMP] sale_global_discount: improve README with reference to the one …
tafaRU Sep 14, 2022
236cd5d
[UPD] README.rst
OCA-git-bot Mar 1, 2022
f05b02d
sale_global_discount 14.0.1.1.0
OCA-git-bot Sep 16, 2022
69ebcca
sale_global_discount: Migration to 15.0
kirca Oct 25, 2022
eafa56f
[FIX] sale_global_discount: compute the taxes widget with global disc…
kirca Dec 22, 2022
95316d2
[IMP] sale_global_discount: black, isort, prettier
ferran-S73 Jan 19, 2023
b670984
[MIG] sale_global_discount: 16.0
ferran-S73 Jan 20, 2023
19b2a6f
[16.0][IMP] sale_global_discount: Remake amount global discount
Rferri44-S73 Jun 21, 2023
4384927
[14.0][IMP] sale_global_discount, added init hook to avoid memory iss…
ChrisOForgeFlow Apr 26, 2023
ad3190b
[UPD] Update sale_global_discount.pot
Jun 28, 2024
bc4384d
[BOT] post-merge updates
OCA-git-bot Jun 28, 2024
f8de8cd
Update translation files
weblate Jul 7, 2024
3b2ec04
Translated using Weblate (Italian)
mymage Jul 8, 2024
3e0ca4a
[IMP] sale_global_discount: pre-commit auto fixes
miguel-S73 Aug 14, 2024
2c11232
[17.0][MIG] sale_global_discount: Migration to 17.0
miguel-S73 Nov 19, 2024
9f8783f
[UPD] Update sale_global_discount.pot
May 8, 2025
621d84d
[BOT] post-merge updates
OCA-git-bot May 8, 2025
14fec99
Translated using Weblate (Spanish)
DantePereyra May 12, 2025
b703c5b
Added translation using Weblate (Catalan)
JavierGalera8 Jun 3, 2025
964303f
Added translation using Weblate (Catalan (ca_ES))
JavierGalera8 Jun 3, 2025
9b45ad8
Translated using Weblate (Catalan)
JavierGalera8 Jun 3, 2025
975a062
[18.0][MIG] sale_global_discount
eugenios73 Sep 12, 2025
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
114 changes: 114 additions & 0 deletions sale_global_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
====================
Sale Global Discount
====================

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

.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_global_discount
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_global_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/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

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

Apply global financial discounts to sales that will be transmited to
invoices and accounting.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module please refer to configure section of the
base_global_discount module.

Usage
=====

To use this module, you need to:

1. See usage section of the base_global_discount module.
2. Create a new sale order and choose a partner.
3. If the partner has customer global discounts set, those will be
applied to the order by default.
4. Otherwise, you can set them manually from the header of the sale
order.
5. In the order footer, you can see the computed discounts.
6. When you create an invoice from the order, the proper global
discounts will be applied on it.

Known issues / Roadmap
======================

- Not all the taxes combination can be compatible with global discounts.
An error is raised in that cases.
- Currently, taxes in invoice lines are mandatory with global discounts.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_global_discount%0Aversion:%2018.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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__

- David Vidal
- Pedro M. Baeza

- Omar Castiñeira <omar@comunitea.com>

- `Studio73 <https://www.studio73.es>`__

- Miguel Gandia

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/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_global_discount>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_global_discount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import _pre_init_global_discount_fields
16 changes: 16 additions & 0 deletions sale_global_discount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2020 Tecnativa - David Vidal
# Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Global Discount",
"version": "18.0.1.0.0",
"category": "Sales Management",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"license": "AGPL-3",
"depends": ["account_global_discount", "sale"],
"data": ["views/sale_order_views.xml", "views/report_sale_order.xml"],
"application": False,
"installable": True,
"pre_init_hook": "_pre_init_global_discount_fields",
}
42 changes: 42 additions & 0 deletions sale_global_discount/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from odoo.tools.sql import column_exists


def _pre_init_global_discount_fields(env):
if not column_exists(env.cr, "sale_order", "amount_global_discount"):
env.cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_global_discount" double precision DEFAULT 0
"""
)
env.cr.execute(
"""
ALTER TABLE "sale_order" ALTER COLUMN "amount_global_discount" DROP DEFAULT
"""
)
if not column_exists(
env.cr, "sale_order", "amount_untaxed_before_global_discounts"
):
env.cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_untaxed_before_global_discounts" double precision
"""
)
env.cr.execute(
"""
UPDATE sale_order SET amount_untaxed_before_global_discounts = amount_untaxed
"""
)
if not column_exists(env.cr, "sale_order", "amount_total_before_global_discounts"):
env.cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_total_before_global_discounts" double precision
"""
)
env.cr.execute(
"""
UPDATE sale_order SET amount_total_before_global_discounts = amount_total
"""
)
86 changes: 86 additions & 0 deletions sale_global_discount/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_global_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-06-03 16:25+0000\n"
"Last-Translator: Francisco Javier Galera Martínez <javier.galera@sygel.es>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: sale_global_discount
#: model_terms:ir.ui.view,arch_db:sale_global_discount.report_saleorder_document
msgid ""
"<strong>Global Discounts</strong>\n"
" <br/>"
msgstr ""
"<strong>Descomptes globals</strong>\n"
" <br/>"

#. module: sale_global_discount
#: model_terms:ir.ui.view,arch_db:sale_global_discount.report_saleorder_document
msgid "<strong>Subtl. before disc.</strong>"
msgstr "<strong>Subtl. abans del disc.</strong>"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_total_before_global_discounts
msgid "Amount Total Before Discounts"
msgstr "Import total abans dels descomptes"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_untaxed_before_global_discounts
msgid "Amount Untaxed Before Discounts"
msgstr "Import no gravat abans dels descomptes"

#. module: sale_global_discount
#. odoo-python
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "Incompatible taxes found for global discounts."
msgstr "S'han trobat impostos incompatibles per a descomptes globals."

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__global_discount_ids
#: model_terms:ir.ui.view,arch_db:sale_global_discount.view_order_form
msgid "Sale Global Discounts"
msgstr "Venda Descomptes globals"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__global_discount_ids_readonly
msgid "Sale Global Discounts (readonly)"
msgstr "Rebaixes i descomptes globals (només lectura)"

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_sale_order
msgid "Sales Order"
msgstr "Comanda de venda"

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línia de comanda de vendes"

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_account_tax
msgid "Tax"
msgstr "Impost"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_global_discount
msgid "Total Global Discounts"
msgstr "Descomptes globals totals"

#. module: sale_global_discount
#. odoo-python
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "With global discounts, taxes in lines are required."
msgstr "Amb descomptes globals, cal afegir impostos a les línies."
82 changes: 82 additions & 0 deletions sale_global_discount/i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_global_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#. module: sale_global_discount
#: model_terms:ir.ui.view,arch_db:sale_global_discount.report_saleorder_document
msgid ""
"<strong>Global Discounts</strong>\n"
" <br/>"
msgstr ""

#. module: sale_global_discount
#: model_terms:ir.ui.view,arch_db:sale_global_discount.report_saleorder_document
msgid "<strong>Subtl. before disc.</strong>"
msgstr ""

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_total_before_global_discounts
msgid "Amount Total Before Discounts"
msgstr ""

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_untaxed_before_global_discounts
msgid "Amount Untaxed Before Discounts"
msgstr ""

#. module: sale_global_discount
#. odoo-python
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "Incompatible taxes found for global discounts."
msgstr ""

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__global_discount_ids
#: model_terms:ir.ui.view,arch_db:sale_global_discount.view_order_form
msgid "Sale Global Discounts"
msgstr ""

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__global_discount_ids_readonly
msgid "Sale Global Discounts (readonly)"
msgstr ""

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_account_tax
msgid "Tax"
msgstr ""

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__amount_global_discount
msgid "Total Global Discounts"
msgstr ""

#. module: sale_global_discount
#. odoo-python
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "With global discounts, taxes in lines are required."
msgstr ""
Loading
Loading