Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] sale_global_discount: calculate lines with fixed taxes should be based on product uom qty #1

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
25f8c1d
[ADD] sale_global_discount: New module
chienandalu Apr 6, 2020
b51c3c3
Translated using Weblate (Spanish)
chienandalu Apr 30, 2020
1c2c024
[FIX] sale_global_discount: wrong property name
chienandalu Jun 30, 2020
3455934
[FIX] sale_global_discount: Constraint tax lines combinations
pedrobaeza Jul 3, 2020
73604a0
[MIG] sale_global_discount: Migration to 12.0
pedrobaeza Jul 20, 2020
145043f
Added translation using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
9e49200
Translated using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
d75a7d2
Translated using Weblate (Portuguese)
pedrocs-exo Sep 17, 2020
bcefa87
[FIX] sale_global_discount: Proper amount_by_group results
pedrobaeza Oct 9, 2020
bbe17ce
[FIX][12.0] sale_global_discount: sale order templates compatibility
pedrocs-exo Oct 13, 2020
2df68ca
sale_global_discount 12.0.1.0.2
OCA-git-bot Oct 15, 2020
ec18277
[IMP] sale_global_discount security
chienandalu Dec 11, 2020
ddf8220
sale_global_discount 12.0.1.1.0
OCA-git-bot Dec 15, 2020
b74ded7
[FIX] sale_global_discount: duplicated label warning
chienandalu Dec 22, 2020
f41c570
sale_global_discount 12.0.1.2.0
OCA-git-bot Dec 23, 2020
5c97357
Translated using Weblate (Portuguese)
pedrocs-exo Jan 5, 2021
8027d00
Translated using Weblate (Spanish)
danimv5 Mar 10, 2021
4e5f7ae
[IMP] sale_global_discount: black, isort, prettier
chienandalu Apr 19, 2021
5ed3eb6
[MIG] sale_global_discount: Migration to 13.0
chienandalu Apr 20, 2021
924ad36
[IMP] sale_global_discount: Remove dead code
pedrobaeza Jul 19, 2021
45e0792
[FIX] sale_global_discount: Create pricelist to use in partners in te…
victoralmau Jul 19, 2021
aa130fd
sale_global_discount 13.0.1.0.2
OCA-git-bot Jul 20, 2021
aee251c
[MIG] sale_global_discount: Migration to 14.0
omar7r Aug 23, 2021
5c411ad
[FIX] sale_global_discount: computed fields must be stored because th…
omar7r Dec 21, 2021
61dda80
[FIX] sale_global_discount: Filtering global discount in on_change by…
omar7r Dec 21, 2021
73bbb90
[FIX] sale_global_discount: Tests
omar7r Feb 22, 2022
b58c026
[UPD] Update sale_global_discount.pot
oca-travis Mar 1, 2022
bc894d8
Added translation using Weblate (Italian)
francesco-ooops Mar 2, 2022
7e1eadc
Translated using Weblate (Italian)
francesco-ooops Mar 2, 2022
bef5ac5
[IMP] sale_global_discount: improve README with reference to the one …
tafaRU Sep 14, 2022
0636399
[UPD] README.rst
OCA-git-bot Mar 1, 2022
b02b7d2
sale_global_discount 14.0.1.1.0
OCA-git-bot Sep 16, 2022
e1ce667
sale_global_discount: Migration to 15.0
kirca Oct 25, 2022
418c892
[FIX] sale_global_discount: compute the taxes widget with global disc…
kirca Dec 22, 2022
711c738
[IMP] sale_global_discount: black, isort, prettier
ferran-S73 Jan 19, 2023
f7ce24e
[MIG] sale_global_discount: 16.0
ferran-S73 Jan 20, 2023
af89522
[16.0][IMP] sale_global_discount: Remake amount global discount
Rferri44-S73 Jun 21, 2023
a46b115
[14.0][IMP] sale_global_discount, added init hook to avoid memory iss…
ChrisOForgeFlow Apr 26, 2023
2e77457
[IMP] sale_global_discount: calculate lines with fixed taxes should b…
May 22, 2024
b2a5699
[DON'T MERGE] test-requirements.txt
May 22, 2024
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
107 changes: 107 additions & 0 deletions sale_global_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
====================
Sale Global Discount
====================

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

.. |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/16.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-16-0/sale-workflow-16-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=16.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:

#. See usage section of the `base_global_discount` module.
#. Create a new sale order and choose a partner.
#. If the partner has customer global discounts set, those will be applied to
the order by default.
#. Otherwise, you can set them manually from the header of the sale order.
#. In the order footer, you can see the computed discounts.
#. 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:%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
=======

Authors
~~~~~~~

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`_

* David Vidal
* Pedro M. Baeza
* Omar Castiñeira <[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.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.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": "16.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",
}
40 changes: 40 additions & 0 deletions sale_global_discount/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from odoo.tools.sql import column_exists


def _pre_init_global_discount_fields(cr):
if not column_exists(cr, "sale_order", "amount_global_discount"):
cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_global_discount" double precision DEFAULT 0
"""
)
cr.execute(
"""
ALTER TABLE "sale_order" ALTER COLUMN "amount_global_discount" DROP DEFAULT
"""
)
if not column_exists(cr, "sale_order", "amount_untaxed_before_global_discounts"):
cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_untaxed_before_global_discounts" double precision
"""
)
cr.execute(
"""
update sale_order set amount_untaxed_before_global_discounts = amount_untaxed
"""
)
if not column_exists(cr, "sale_order", "amount_total_before_global_discounts"):
cr.execute(
"""
ALTER TABLE "sale_order"
ADD COLUMN "amount_total_before_global_discounts" double precision
"""
)
cr.execute(
"""
update sale_order set amount_total_before_global_discounts = amount_total
"""
)
77 changes: 77 additions & 0 deletions sale_global_discount/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_global_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-06 14:38+0000\n"
"PO-Revision-Date: 2021-03-10 10:45+0000\n"
"Last-Translator: Daniel Martinez Vila <[email protected]>\n"
"Language-Team: \n"
"Language: 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"
"X-Generator: Weblate 4.3.2\n"

#. module: sale_global_discount
#: model_terms:ir.ui.view,arch_db:sale_global_discount.report_saleorder_document
msgid "<strong>Global Discounts</strong><br/>"
msgstr "<strong>Descuentos Globales</strong><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. antes desc.</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 "Base Imponible sin Descuentos"

#. 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 "Base Imponible sin Descuentos"

#. module: sale_global_discount
#: code:addons/sale_global_discount/models/sale_order.py:74
#, python-format
msgid "Incompatible taxes found for global discounts."
msgstr "Se han encontrado impuestos incompatibles para descuentos globales."

#. 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 "Descuentos de venta globales"

#. 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 "Venta Descuentos Globales (solo lectura)"

#. module: sale_global_discount
#: model:ir.model,name:sale_global_discount.model_sale_order
msgid "Sale Order"
msgstr "Pedido de venta"

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

#. module: sale_global_discount
#: code:addons/sale_global_discount/models/sale_order.py:67
#, python-format
msgid "With global discounts, taxes in lines are required."
msgstr "Con descuentos globales, se requieren impuestos en líneas."

#~ msgid "Quotation"
#~ msgstr "Presupuesto"

#~ msgid "<strong>Global Discount</strong>"
#~ msgstr "<strong>Descuento Global</strong>"
89 changes: 89 additions & 0 deletions sale_global_discount/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_global_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-03-02 18:31+0000\n"
"Last-Translator: Francesco Foresti <[email protected]>\n"
"Language-Team: none\n"
"Language: it\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 4.3.2\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>Sconti Globali</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>Subtot. prima degli sconti</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 "Importo Totale prima degli sconti"

#. 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 "Imponibile prima degli sconti"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__display_name
msgid "Display Name"
msgstr "Nome da visualizzare"

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order__id
msgid "ID"
msgstr "ID"

#. module: sale_global_discount
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "Incompatible taxes found for global discounts."
msgstr "Sono presenti tasse incompatibili per gli sconti globali."

#. module: sale_global_discount
#: model:ir.model.fields,field_description:sale_global_discount.field_sale_order____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. 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 "Sconti Globali Vendite"

#. 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 "Sconti Globali Vendite (sola lettura)"

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

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

#. module: sale_global_discount
#: code:addons/sale_global_discount/models/sale_order.py:0
#, python-format
msgid "With global discounts, taxes in lines are required."
msgstr "Con gli sconti globali, sono necessarie le tasse sulle righe ordine."
Loading