diff --git a/stock_picking_quick_quantity_done/__manifest__.py b/stock_picking_quick_quantity_done/__manifest__.py index 9c2e05e4..cd70046d 100644 --- a/stock_picking_quick_quantity_done/__manifest__.py +++ b/stock_picking_quick_quantity_done/__manifest__.py @@ -11,7 +11,7 @@ "application": False, "installable": True, "depends": [ - "sale", + "sale_management", "stock", ], "data": [ diff --git a/stock_picking_quick_quantity_done/i18n/fr.po b/stock_picking_quick_quantity_done/i18n/fr.po index 1f02f05f..69eb14fd 100644 --- a/stock_picking_quick_quantity_done/i18n/fr.po +++ b/stock_picking_quick_quantity_done/i18n/fr.po @@ -1,14 +1,14 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_picking_quick_quantity_done +# * stock_picking_quick_quantity_done # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-02 10:25+0000\n" -"PO-Revision-Date: 2020-09-02 10:25+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2025-02-20 09:43+0000\n" +"PO-Revision-Date: 2025-02-20 09:43+0000\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,21 +21,12 @@ msgid "Force Availability" msgstr "Forcer les disponibilités" #. module: stock_picking_quick_quantity_done -#: model:ir.model.fields,field_description:stock_picking_quick_quantity_done.field_stock_move_line__product_initial_demand -msgid "Initial Demand" -msgstr "Demande initiale" - -#. module: stock_picking_quick_quantity_done -#: code:addons/stock_picking_quick_quantity_done/models/stock_picking.py:34 +#. odoo-python +#: code:addons/stock_picking_quick_quantity_done/models/stock_picking.py:0 #, python-format msgid "Nothing to check the availability for." msgstr "Aucune quantité de disponibilité à vérifier." -#. module: stock_picking_quick_quantity_done -#: model:ir.model,name:stock_picking_quick_quantity_done.model_stock_move_line -msgid "Product Moves (Stock Move Line)" -msgstr "" - #. module: stock_picking_quick_quantity_done #: model_terms:ir.ui.view,arch_db:stock_picking_quick_quantity_done.view_stock_picking_quick_quantity_done msgid "Quickly set quantity done with initial demand" @@ -43,8 +34,8 @@ msgstr "Rapidement définir les quantités livrées avec la demande initiale" #. module: stock_picking_quick_quantity_done #: model:ir.model,name:stock_picking_quick_quantity_done.model_sale_order -msgid "Sale Order" -msgstr "" +msgid "Sales Order" +msgstr "Bon de commande" #. module: stock_picking_quick_quantity_done #: model:ir.model.fields,field_description:stock_picking_quick_quantity_done.field_stock_picking__show_quick_quantities_done @@ -63,26 +54,30 @@ msgstr "Mouvement de stock" #. module: stock_picking_quick_quantity_done #: model:ir.model.fields,help:stock_picking_quick_quantity_done.field_stock_picking__show_quick_quantities_done -msgid "Technical field used to compute whether the quick quantities done button should be shown." +msgid "" +"Technical field used to compute whether the quick quantities done button " +"should be shown." msgstr "" #. module: stock_picking_quick_quantity_done #: model:ir.model.fields,help:stock_picking_quick_quantity_done.field_stock_move__show_quick_quantity_done -msgid "Technical field used to compute whether the quick quantity done button should be shown." +msgid "" +"Technical field used to compute whether the quick quantity done button " +"should be shown." msgstr "" -#. module: stock_picking_quick_quantity_done -#: model:ir.model.fields,help:stock_picking_quick_quantity_done.field_stock_move_line__product_initial_demand -msgid "This is the quantity of products from an inventory point of view. For moves in the state 'done', this is the quantity of products that were actually moved. For other moves, this is the quantity of product that is planned to be moved. Lowering this quantity does not generate a backorder. Changing this quantity on assigned moves affects the product reservation, and should be done with care." -msgstr "Ceci est la quantité de produits depuis le point de vue de l'inventaire. Pour les mouvements dans l'état \"Terminé\", c'est la quantité de produits qui a été effectivement déplacée. Pour les autres mouvements, c'est la quantité de produits qu'il est prévu de déplacer. Abaisser cette quantité ne génère pas de reliquat. La modification de cette quantité sur les mouvements assignés affecte la réservation de marchandise, et doit être faite avec soin." - #. module: stock_picking_quick_quantity_done #: model:ir.model,name:stock_picking_quick_quantity_done.model_stock_picking msgid "Transfer" msgstr "Transfert" #. module: stock_picking_quick_quantity_done -#: code:addons/stock_picking_quick_quantity_done/models/stock_move.py:33 +#. odoo-python +#: code:addons/stock_picking_quick_quantity_done/models/stock_move.py:0 #, python-format -msgid "We can't quickly set quantity done because there's no initial demand or it's null." -msgstr "On ne peut pas déterminer rapidement les quantités livrées car il n'y a pas de quantité initiale demandée ou elle est nulle." +msgid "" +"We can't quickly set quantity done because there's no initial demand or it's" +" null." +msgstr "" +"On ne peut pas déterminer rapidement les quantités livrées car il n'y a pas " +"de quantité initiale demandée ou elle est nulle." \ No newline at end of file diff --git a/stock_picking_quick_quantity_done/models/__init__.py b/stock_picking_quick_quantity_done/models/__init__.py index 0ec2bed7..a6b9e0ef 100644 --- a/stock_picking_quick_quantity_done/models/__init__.py +++ b/stock_picking_quick_quantity_done/models/__init__.py @@ -1,4 +1,3 @@ from . import sale_order from . import stock_move -from . import stock_move_line from . import stock_picking diff --git a/stock_picking_quick_quantity_done/models/sale_order.py b/stock_picking_quick_quantity_done/models/sale_order.py index ae757fbc..bf183c13 100644 --- a/stock_picking_quick_quantity_done/models/sale_order.py +++ b/stock_picking_quick_quantity_done/models/sale_order.py @@ -9,7 +9,7 @@ class SaleOrder(models.Model): _inherit = "sale.order" def action_confirm(self): - """After Confirm, force stock.move.line to be full, ready to be + """After Confirm, force stock.move to be full, ready to be validated""" super().action_confirm() for picking in self.mapped("picking_ids").filtered( diff --git a/stock_picking_quick_quantity_done/models/stock_move.py b/stock_picking_quick_quantity_done/models/stock_move.py index 3c7ed0eb..48176fee 100644 --- a/stock_picking_quick_quantity_done/models/stock_move.py +++ b/stock_picking_quick_quantity_done/models/stock_move.py @@ -3,14 +3,13 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, models -from odoo.exceptions import Warning as UserError +from odoo.exceptions import UserError class StockMove(models.Model): _inherit = "stock.move" show_quick_quantity_done = fields.Boolean( - default=False, compute="_compute_show_quick_quantity_done", help="Technical field used to compute whether the quick quantity" " done button should be shown.", @@ -20,6 +19,8 @@ def _compute_show_quick_quantity_done(self): for move in self: if move.quantity_done < move.product_uom_qty: move.show_quick_quantity_done = True + else: + move.show_quick_quantity_done = False def quick_quantity_done(self): for move in self: diff --git a/stock_picking_quick_quantity_done/models/stock_move_line.py b/stock_picking_quick_quantity_done/models/stock_move_line.py deleted file mode 100644 index fa08f518..00000000 --- a/stock_picking_quick_quantity_done/models/stock_move_line.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2017 - Today: GRAP (http://www.grap.coop) -# @author Quentin DUPONT (quentin.dupont@grap.coop) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import fields, models - - -class StockMoveLine(models.Model): - _inherit = "stock.move.line" - - product_initial_demand = fields.Float( - string="Initial Demand", - default=0.0, - required=True, - states={"done": [("readonly", True)]}, - related="move_id.product_uom_qty", - ) diff --git a/stock_picking_quick_quantity_done/models/stock_picking.py b/stock_picking_quick_quantity_done/models/stock_picking.py index 2f0cf33b..2dbaee1e 100644 --- a/stock_picking_quick_quantity_done/models/stock_picking.py +++ b/stock_picking_quick_quantity_done/models/stock_picking.py @@ -3,31 +3,31 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, models -from odoo.exceptions import Warning as UserError +from odoo.exceptions import UserError class StockPicking(models.Model): _inherit = "stock.picking" show_quick_quantities_done = fields.Boolean( - default=False, compute="_compute_show_quick_quantities_done", help="Technical field used to compute whether the quick quantities" " done button should be shown.", ) + @api.depends("move_ids") def _compute_show_quick_quantities_done(self): for picking in self: - moves = self.mapped("move_lines").filtered( + moves = picking.mapped("move_ids").filtered( lambda move: move.state not in ("draft", "cancel", "done") ) + picking.show_quick_quantities_done = False for move in moves: - if move.show_quick_quantity_done: - picking.show_quick_quantities_done = True + picking.show_quick_quantities_done = True if move.show_quick_quantity_done else False def quick_quantities_done(self): for picking in self: - moves = picking.mapped("move_lines").filtered( + moves = picking.mapped("move_ids").filtered( lambda move: move.state not in ("draft", "cancel", "done") ) if not moves: diff --git a/stock_picking_quick_quantity_done/tests/test_stock_picking_quick_quantity_done.py b/stock_picking_quick_quantity_done/tests/test_stock_picking_quick_quantity_done.py index ff3ba3b7..acc3d2ba 100644 --- a/stock_picking_quick_quantity_done/tests/test_stock_picking_quick_quantity_done.py +++ b/stock_picking_quick_quantity_done/tests/test_stock_picking_quick_quantity_done.py @@ -26,7 +26,7 @@ def setUp(self): "picking_type_id": picking_type_out.id, "location_id": stock_location.id, "location_dest_id": customer_location.id, - "move_lines": [ + "move_ids": [ ( 0, 0, @@ -63,7 +63,7 @@ def setUp(self): "picking_type_id": picking_type_out.id, "location_id": stock_location.id, "location_dest_id": customer_location.id, - "move_lines": [ + "move_ids": [ ( 0, 0, diff --git a/stock_picking_quick_quantity_done/views/view_stock_picking.xml b/stock_picking_quick_quantity_done/views/view_stock_picking.xml index dbcc8a89..ce8ee4c4 100644 --- a/stock_picking_quick_quantity_done/views/view_stock_picking.xml +++ b/stock_picking_quick_quantity_done/views/view_stock_picking.xml @@ -34,10 +34,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). attrs="{'invisible': [('show_quick_quantity_done', '=', False)]}"> - - - -