diff --git a/stock_move_location/i18n/es.po b/stock_move_location/i18n/es.po index 2feee6714..675d7cdbf 100644 --- a/stock_move_location/i18n/es.po +++ b/stock_move_location/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-02 20:30+0000\n" -"PO-Revision-Date: 2020-11-02 21:37+0100\n" +"POT-Creation-Date: 2021-02-25 08:19+0000\n" +"PO-Revision-Date: 2021-02-25 09:20+0100\n" "Last-Translator: Sergio Teruel \n" "Language-Team: none\n" "Language: es\n" @@ -77,6 +77,11 @@ msgstr "Nombre mostrado" msgid "Edit Locations" msgstr "(editar)" +#. module: stock_move_location +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__owner_id +msgid "From Owner" +msgstr "Propietario" + #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__id #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__id @@ -229,13 +234,11 @@ msgstr "Si este movimiento es parte de movimiento de ubicaciones" #. module: stock_move_location #: model:ir.model,name:stock_move_location.model_wiz_stock_move_location -#, fuzzy msgid "Wizard move location" msgstr "Asistente para mover desde ubicación" #. module: stock_move_location #: model:ir.model,name:stock_move_location.model_wiz_stock_move_location_line -#, fuzzy msgid "Wizard move location line" msgstr "Asistente para mover desde ubicación" diff --git a/stock_move_location/i18n/stock_move_location.pot b/stock_move_location/i18n/stock_move_location.pot index bf553833e..2e7d5c9d8 100644 --- a/stock_move_location/i18n/stock_move_location.pot +++ b/stock_move_location/i18n/stock_move_location.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-02-25 08:19+0000\n" +"PO-Revision-Date: 2021-02-25 08:19+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -73,6 +75,11 @@ msgstr "" msgid "Edit Locations" msgstr "" +#. module: stock_move_location +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__owner_id +msgid "From Owner" +msgstr "" + #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__id #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__id @@ -140,6 +147,7 @@ msgstr "" #. module: stock_move_location #: code:addons/stock_move_location/wizard/stock_move_location_line.py:0 +#: code:addons/stock_move_location/wizard/stock_move_location_line.py:0 #, python-format msgid "Move quantity can not exceed max quantity or be negative" msgstr "" diff --git a/stock_move_location/wizard/stock_move_location.py b/stock_move_location/wizard/stock_move_location.py index f6461ed59..48f3c0bc6 100644 --- a/stock_move_location/wizard/stock_move_location.py +++ b/stock_move_location/wizard/stock_move_location.py @@ -93,6 +93,7 @@ class StockMoveLocationWizard(models.TransientModel): "reserved_quantity": quant.reserved_quantity, "origin_location_id": quant.location_id.id, "lot_id": quant.lot_id.id, + "owner_id": quant.owner_id.id, "product_uom_id": quant.product_uom_id.id, "custom": False, }, @@ -196,6 +197,7 @@ class StockMoveLocationWizard(models.TransientModel): ("product_id", "=", line.product_id.id), ("location_id", "=", line.origin_location_id.id), ("lot_id", "=", line.lot_id.id), + ("owner_id", "=", line.owner_id.id), ("product_uom_qty", ">", 0.0), ] ) @@ -234,11 +236,11 @@ class StockMoveLocationWizard(models.TransientModel): # Using sql as search_group doesn't support aggregation functions # leading to overhead in queries to DB query = """ - SELECT product_id, lot_id, SUM(quantity) AS quantity, + SELECT product_id, lot_id, owner_id, SUM(quantity) AS quantity, SUM(reserved_quantity) AS reserved_quantity FROM stock_quant WHERE location_id = %s - GROUP BY product_id, lot_id + GROUP BY product_id, lot_id, owner_id """ self.env.cr.execute(query, (location_id.id,)) return self.env.cr.dictfetchall() @@ -264,6 +266,7 @@ class StockMoveLocationWizard(models.TransientModel): "destination_location_id": location_dest_id, # cursor returns None instead of False "lot_id": group.get("lot_id") or False, + "owner_id": group.get("owner_id") or False, "product_uom_id": product.uom_id.id, "custom": False, } diff --git a/stock_move_location/wizard/stock_move_location.xml b/stock_move_location/wizard/stock_move_location.xml index 97beb3a01..e3e37bb4f 100644 --- a/stock_move_location/wizard/stock_move_location.xml +++ b/stock_move_location/wizard/stock_move_location.xml @@ -77,6 +77,10 @@ groups="stock.group_production_lot" options="{'no_create': True}" /> + make the transfer of 0. - return 0 + return 0, 0 rounding = self.product_uom_id.rounding available_qty_lt_move_qty = ( self._compare(available_qty, self.move_quantity, rounding) == -1 ) if available_qty_lt_move_qty: - return available_qty + return 0, available_qty return 0, self.move_quantity