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

[17.0][MIG] sale_global_discount: standard migration to 17.0 #3025

Open
wants to merge 45 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ae0a06f
[ADD] sale_global_discount: New module
chienandalu Apr 6, 2020
38d23d0
Translated using Weblate (Spanish)
chienandalu Apr 30, 2020
695b175
[FIX] sale_global_discount: wrong property name
chienandalu Jun 30, 2020
fe8998b
[FIX] sale_global_discount: Constraint tax lines combinations
pedrobaeza Jul 3, 2020
0a4df6c
[MIG] sale_global_discount: Migration to 12.0
pedrobaeza Jul 20, 2020
21e3cf8
Added translation using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
61d90e9
Translated using Weblate (Portuguese)
pedrocs-exo Sep 15, 2020
45b1ba9
Translated using Weblate (Portuguese)
pedrocs-exo Sep 17, 2020
556d8a7
[FIX] sale_global_discount: Proper amount_by_group results
pedrobaeza Oct 9, 2020
817c387
[FIX][12.0] sale_global_discount: sale order templates compatibility
pedrocs-exo Oct 13, 2020
426e324
sale_global_discount 12.0.1.0.2
OCA-git-bot Oct 15, 2020
d16b119
[IMP] sale_global_discount security
chienandalu Dec 11, 2020
ff273cd
sale_global_discount 12.0.1.1.0
OCA-git-bot Dec 15, 2020
139fada
[FIX] sale_global_discount: duplicated label warning
chienandalu Dec 22, 2020
703358e
sale_global_discount 12.0.1.2.0
OCA-git-bot Dec 23, 2020
0c0e1e7
Translated using Weblate (Portuguese)
pedrocs-exo Jan 5, 2021
bbc55cf
Translated using Weblate (Spanish)
danimv5 Mar 10, 2021
cca4519
[IMP] sale_global_discount: black, isort, prettier
chienandalu Apr 19, 2021
2f01512
[MIG] sale_global_discount: Migration to 13.0
chienandalu Apr 20, 2021
4761229
[IMP] sale_global_discount: Remove dead code
pedrobaeza Jul 19, 2021
2e65843
[FIX] sale_global_discount: Create pricelist to use in partners in te…
victoralmau Jul 19, 2021
c54d12f
sale_global_discount 13.0.1.0.2
OCA-git-bot Jul 20, 2021
baf5c6c
[MIG] sale_global_discount: Migration to 14.0
omar7r Aug 23, 2021
1579d74
[FIX] sale_global_discount: computed fields must be stored because th…
omar7r Dec 21, 2021
b5757e1
[FIX] sale_global_discount: Filtering global discount in on_change by…
omar7r Dec 21, 2021
eb6bc1a
[FIX] sale_global_discount: Tests
omar7r Feb 22, 2022
0fb99b2
[UPD] Update sale_global_discount.pot
oca-travis Mar 1, 2022
54c7020
Added translation using Weblate (Italian)
francesco-ooops Mar 2, 2022
8c329a6
Translated using Weblate (Italian)
francesco-ooops Mar 2, 2022
49c358d
[IMP] sale_global_discount: improve README with reference to the one …
tafaRU Sep 14, 2022
2296f2e
[UPD] README.rst
OCA-git-bot Mar 1, 2022
b443208
sale_global_discount 14.0.1.1.0
OCA-git-bot Sep 16, 2022
7ba3949
sale_global_discount: Migration to 15.0
kirca Oct 25, 2022
c032ad4
[FIX] sale_global_discount: compute the taxes widget with global disc…
kirca Dec 22, 2022
9a56089
[IMP] sale_global_discount: black, isort, prettier
ferran-S73 Jan 19, 2023
04b2033
[MIG] sale_global_discount: 16.0
ferran-S73 Jan 20, 2023
27a834e
[16.0][IMP] sale_global_discount: Remake amount global discount
Rferri44-S73 Jun 21, 2023
e410fda
[14.0][IMP] sale_global_discount, added init hook to avoid memory iss…
ChrisOForgeFlow Apr 26, 2023
754910f
[UPD] Update sale_global_discount.pot
Jun 28, 2024
ea7a376
[BOT] post-merge updates
OCA-git-bot Jun 28, 2024
ac6cedb
Update translation files
weblate Jul 7, 2024
b84ce1a
Translated using Weblate (Italian)
mymage Jul 8, 2024
3685774
[IMP] sale_global_discount: pre-commit auto fixes
miguel-S73 Aug 14, 2024
4c1ab0b
[17.0][MIG] sale_global_discount: Migration to 17.0
miguel-S73 Nov 19, 2024
e823989
[DON'T MERGE] test-requirements.txt
ferran-S73 Jan 13, 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
116 changes: 116 additions & 0 deletions sale_global_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
====================
Sale Global Discount
====================

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

.. |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/17.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-17-0/sale-workflow-17-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=17.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:%2017.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]>

- `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/17.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": "17.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
"""
)
97 changes: 97 additions & 0 deletions sale_global_discount/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 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>\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 "<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
#. odoo-python
#: code:addons/sale_global_discount/models/sale_order.py:0
#, 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 "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 "Total Descuentos Globales"

#. 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 "Con descuentos globales, se requieren impuestos en líneas."

#~ msgid "<strong>Global Discounts</strong><br/>"
#~ msgstr "<strong>Descuentos Globales</strong><br/>"

#~ msgid "Sale Order"
#~ msgstr "Pedido de venta"

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

#~ msgid "<strong>Global Discount</strong>"
#~ msgstr "<strong>Descuento Global</strong>"
95 changes: 95 additions & 0 deletions sale_global_discount/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# 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: 2024-07-08 08:59+0000\n"
"Last-Translator: mymage <[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 5.6.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
#. odoo-python
#: 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__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,name:sale_global_discount.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"

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

#. 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
#. odoo-python
#: 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."

#~ msgid "Display Name"
#~ msgstr "Nome da visualizzare"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
Loading
Loading