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][MIG] sale_global_discount: 16.0 #2343

Merged
merged 38 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dc59d34
[ADD] sale_global_discount: New module
chienandalu Apr 6, 2020
21dd157
Translated using Weblate (Spanish)
chienandalu Apr 30, 2020
c381036
[FIX] sale_global_discount: wrong property name
chienandalu Jun 30, 2020
d49125d
[FIX] sale_global_discount: Constraint tax lines combinations
pedrobaeza Jul 3, 2020
fb1237f
[MIG] sale_global_discount: Migration to 12.0
pedrobaeza Jul 20, 2020
da0fd96
Added translation using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
f8bf3ee
Translated using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
1b4e38a
Translated using Weblate (Portuguese)
pedrocs-exo Sep 17, 2020
280446b
[FIX] sale_global_discount: Proper amount_by_group results
pedrobaeza Oct 9, 2020
ab43020
[FIX][12.0] sale_global_discount: sale order templates compatibility
pedrocs-exo Oct 13, 2020
002dad9
sale_global_discount 12.0.1.0.2
OCA-git-bot Oct 15, 2020
bea2dab
[IMP] sale_global_discount security
chienandalu Dec 11, 2020
dbdee22
sale_global_discount 12.0.1.1.0
OCA-git-bot Dec 15, 2020
e3a8175
[FIX] sale_global_discount: duplicated label warning
chienandalu Dec 22, 2020
a44fb45
sale_global_discount 12.0.1.2.0
OCA-git-bot Dec 23, 2020
0ec4e61
Translated using Weblate (Portuguese)
pedrocs-exo Jan 5, 2021
01c820a
Translated using Weblate (Spanish)
danimv5 Mar 10, 2021
014451a
[IMP] sale_global_discount: black, isort, prettier
chienandalu Apr 19, 2021
67c5c33
[MIG] sale_global_discount: Migration to 13.0
chienandalu Apr 20, 2021
37f79b2
[IMP] sale_global_discount: Remove dead code
pedrobaeza Jul 19, 2021
fdbf94b
[FIX] sale_global_discount: Create pricelist to use in partners in te…
victoralmau Jul 19, 2021
8282f7c
sale_global_discount 13.0.1.0.2
OCA-git-bot Jul 20, 2021
2cdd738
[MIG] sale_global_discount: Migration to 14.0
omar7r Aug 23, 2021
0af7f1f
[FIX] sale_global_discount: computed fields must be stored because th…
omar7r Dec 21, 2021
609e489
[FIX] sale_global_discount: Filtering global discount in on_change by…
omar7r Dec 21, 2021
b6b5812
[FIX] sale_global_discount: Tests
omar7r Feb 22, 2022
a189cce
[UPD] Update sale_global_discount.pot
oca-travis Mar 1, 2022
2464ec6
Added translation using Weblate (Italian)
francesco-ooops Mar 2, 2022
72836b3
Translated using Weblate (Italian)
francesco-ooops Mar 2, 2022
ebc01f3
[IMP] sale_global_discount: improve README with reference to the one …
tafaRU Sep 14, 2022
55f5f87
[UPD] README.rst
OCA-git-bot Mar 1, 2022
3ceeab6
sale_global_discount 14.0.1.1.0
OCA-git-bot Sep 16, 2022
8e1dd2e
sale_global_discount: Migration to 15.0
kirca Oct 25, 2022
32f60aa
[FIX] sale_global_discount: compute the taxes widget with global disc…
kirca Dec 22, 2022
a6e38a2
[IMP] sale_global_discount: black, isort, prettier
ferran-S73 Jan 19, 2023
8e464a8
[MIG] sale_global_discount: 16.0
ferran-S73 Jan 20, 2023
257971e
[16.0][IMP] sale_global_discount: Remake amount global discount
Rferri44-S73 Jun 21, 2023
ded6836
[14.0][IMP] sale_global_discount, added init hook to avoid memory iss…
ChrisOForgeFlow Apr 26, 2023
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
Loading