Skip to content

Commit

Permalink
MIG 16.0 : remove useless initial_demand on move_line, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinDupont committed Feb 20, 2025
1 parent dbbe44c commit 9c0c2ee
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 62 deletions.
2 changes: 1 addition & 1 deletion stock_picking_quick_quantity_done/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"application": False,
"installable": True,
"depends": [
"sale",
"sale_management",
"stock",
],
"data": [
Expand Down
51 changes: 23 additions & 28 deletions stock_picking_quick_quantity_done/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -21,30 +21,21 @@ 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"
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
Expand All @@ -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."
1 change: 0 additions & 1 deletion stock_picking_quick_quantity_done/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from . import sale_order
from . import stock_move
from . import stock_move_line
from . import stock_picking
2 changes: 1 addition & 1 deletion stock_picking_quick_quantity_done/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions stock_picking_quick_quantity_done/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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:
Expand Down
17 changes: 0 additions & 17 deletions stock_picking_quick_quantity_done/models/stock_move_line.py

This file was deleted.

12 changes: 6 additions & 6 deletions stock_picking_quick_quantity_done/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
attrs="{'invisible': [('show_quick_quantity_done', '=', False)]}">
</button>
</field>
<!-- Opérations détaillés -->
<xpath expr="//field[@name='product_uom_qty']" position="before">
<field name="product_initial_demand"/>
</xpath>
</field>
</record>

Expand Down

0 comments on commit 9c0c2ee

Please sign in to comment.