forked from OCA/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] backport not-committed pr on 14.0
- Loading branch information
1 parent
c4126c4
commit ffbf685
Showing
10 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_discount_display_amount | ||
# * sale_discount_display_amount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-09-03 13:37+0000\n" | ||
"Last-Translator: Francesco Foresti <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"POT-Creation-Date: 2024-03-11 08:38+0000\n" | ||
"PO-Revision-Date: 2024-03-11 08:38+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \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.17\n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model_terms:ir.ui.view,arch_db:sale_discount_display_amount.report_saleorder_document_inherit | ||
|
@@ -26,11 +25,17 @@ msgstr "<strong>Subtotale Sconto</strong>" | |
msgid "<strong>Subtotal Without Discount</strong>" | ||
msgstr "<strong>Subtotale senza sconto</strong>" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order__discount_subtotal | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order_line__discount_subtotal | ||
msgid "Discount Subtotal" | ||
msgstr "Sconto concordato" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order__discount_total | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order_line__discount_total | ||
msgid "Discount Subtotal" | ||
msgstr "Subtotale sconto" | ||
msgid "Discount total" | ||
msgstr "Sconto concordato" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model:ir.model,name:sale_discount_display_amount.model_sale_order | ||
|
@@ -40,10 +45,17 @@ msgstr "Ordine di vendita" | |
#. module: sale_discount_display_amount | ||
#: model:ir.model,name:sale_discount_display_amount.model_sale_order_line | ||
msgid "Sales Order Line" | ||
msgstr "Riga ordine di vendita" | ||
msgstr "Linea d'ordine di vendita" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order__price_subtotal_no_discount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order_line__price_subtotal_no_discount | ||
msgid "Subtotal Without Discount" | ||
msgstr "Imponibile parziale" | ||
|
||
#. module: sale_discount_display_amount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order__price_total_no_discount | ||
#: model:ir.model.fields,field_description:sale_discount_display_amount.field_sale_order_line__price_total_no_discount | ||
msgid "Subtotal Without Discount" | ||
msgstr "Subtotale senza sconto" | ||
msgid "Total Without Discount" | ||
msgstr "Imponibile parziale" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
sale_discount_display_amount/migrations/12.0.1.3.0/post-compute-subtotal-columns.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import logging | ||
|
||
from odoo import SUPERUSER_ID | ||
from odoo.api import Environment | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def migrate(cr, version): | ||
_logger.info("Compute discount columns") | ||
env = Environment(cr, SUPERUSER_ID, {}) | ||
|
||
query = """ | ||
select distinct order_id from sale_order_line where discount > 0.0; | ||
""" | ||
|
||
cr.execute(query) | ||
order_ids = cr.fetchall() | ||
|
||
orders = env["sale.order"].search([("id", "in", order_ids)]) | ||
orders.mapped("order_line")._compute_discount() |
17 changes: 17 additions & 0 deletions
17
sale_discount_display_amount/migrations/12.0.1.3.0/pre-add-subtotal-columns.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import logging | ||
|
||
from odoo.tools.sql import column_exists, create_column | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
COLUMNS = ( | ||
("sale_order", "discount_subtotal"), | ||
("sale_order_line", "discount_subtotal"), | ||
) | ||
|
||
|
||
def migrate(cr, version): | ||
for table, column in COLUMNS: | ||
if not column_exists(cr, table, column): | ||
_logger.info("Create discount column %s in database", column) | ||
create_column(cr, table, column, "numeric") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters