diff --git a/sale_line_refund_to_invoice_qty/README.rst b/sale_line_refund_to_invoice_qty/README.rst index 931a1ab6395..1cab53cdbc1 100644 --- a/sale_line_refund_to_invoice_qty/README.rst +++ b/sale_line_refund_to_invoice_qty/README.rst @@ -72,6 +72,7 @@ Contributors * Jordi Masvidal * Lois Rilo +* Denis Roussel Maintainers ~~~~~~~~~~~ diff --git a/sale_line_refund_to_invoice_qty/__init__.py b/sale_line_refund_to_invoice_qty/__init__.py index 433b1e1ff4a..93610a69c7e 100644 --- a/sale_line_refund_to_invoice_qty/__init__.py +++ b/sale_line_refund_to_invoice_qty/__init__.py @@ -1,5 +1,5 @@ # Copyright 2021 ForgeFlow (http://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). - +from .hooks import pre_init_hook from . import models from . import wizards diff --git a/sale_line_refund_to_invoice_qty/__manifest__.py b/sale_line_refund_to_invoice_qty/__manifest__.py index 66aa858d0ae..d6f5000c201 100644 --- a/sale_line_refund_to_invoice_qty/__manifest__.py +++ b/sale_line_refund_to_invoice_qty/__manifest__.py @@ -17,4 +17,8 @@ "views/sale_order_views.xml", "wizards/account_move_reversal_view.xml", ], + "external_dependencies": { + "python": ["openupgradelib"], + }, + "pre_init_hook": "pre_init_hook", } diff --git a/sale_line_refund_to_invoice_qty/hooks.py b/sale_line_refund_to_invoice_qty/hooks.py new file mode 100644 index 00000000000..166b4f1e36f --- /dev/null +++ b/sale_line_refund_to_invoice_qty/hooks.py @@ -0,0 +1,28 @@ +# Copyright 2025 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + +from odoo import SUPERUSER_ID, api + + +def pre_init_hook(cr): + """ + Initialize 'sale_qty_to_reinvoice' field with sql default value + for performances reasons as Odoo does it with an update instead. + """ + if openupgrade.column_exists(cr, "account_move_line", "sale_qty_to_reinvoice"): + return + + env = api.Environment(cr, SUPERUSER_ID, {}) + field_spec = [ + ( + "sale_qty_to_reinvoice", + "account.move.line", + "account_move_line", + "boolean", + "boolean", + "sale_line_refund_to_invoice_qty", + True, + ) + ] + openupgrade.add_fields(env, field_spec=field_spec) diff --git a/sale_line_refund_to_invoice_qty/readme/CONTRIBUTORS.rst b/sale_line_refund_to_invoice_qty/readme/CONTRIBUTORS.rst index 90dd6c9906b..be6cb69135b 100644 --- a/sale_line_refund_to_invoice_qty/readme/CONTRIBUTORS.rst +++ b/sale_line_refund_to_invoice_qty/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Jordi Masvidal * Lois Rilo +* Denis Roussel diff --git a/sale_line_refund_to_invoice_qty/static/description/index.html b/sale_line_refund_to_invoice_qty/static/description/index.html index 923633f96d9..c962f4813a2 100644 --- a/sale_line_refund_to_invoice_qty/static/description/index.html +++ b/sale_line_refund_to_invoice_qty/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -417,12 +417,15 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.