diff --git a/stock_move_location/__manifest__.py b/stock_move_location/__manifest__.py index 09274942b..b49f66f29 100644 --- a/stock_move_location/__manifest__.py +++ b/stock_move_location/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Move Stock Location", - "version": "12.0.1.2.0", + "version": "12.0.1.3.0", "author": "Julius Network Solutions, " "Odoo Community Association (OCA)", "summary": "This module allows to move all stock " diff --git a/stock_move_location/i18n/es.po b/stock_move_location/i18n/es.po index b4632de33..0c4e6b1f6 100644 --- a/stock_move_location/i18n/es.po +++ b/stock_move_location/i18n/es.po @@ -6,15 +6,26 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-04-25 16:16+0000\n" +"POT-Creation-Date: 2020-02-03 17:13+0000\n" +"PO-Revision-Date: 2020-02-03 18:15+0100\n" "Last-Translator: Enric Tobella \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5.1\n" +"X-Generator: Poedit 2.0.6\n" + +#. module: stock_move_location +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__apply_putaway_strategy +msgid "Apply putaway strategy" +msgstr "Aplicar estrategia de traslado" + +#. module: stock_move_location +#: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location +msgid "Apply putaway strategy for moving products" +msgstr "Aplicar estrategia de traslado para los movimientos de producto" #. module: stock_move_location #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location @@ -39,7 +50,7 @@ msgid "Created on" msgstr "Creado el" #. module: stock_move_location -#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__custom +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_custom msgid "Custom line" msgstr "Línea personalizada" @@ -54,7 +65,7 @@ msgstr "Ubicación de destino" #, fuzzy #| msgid "Destination Location" msgid "Destination Location Disable" -msgstr "Ubicación de destino" +msgstr "Ubicación destino" #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__display_name @@ -68,11 +79,11 @@ msgstr "Nombre mostrado" #, fuzzy #| msgid "Origin Location" msgid "Edit Locations" -msgstr "Ubicación de origen" +msgstr "(editar)" #. 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 +#: 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 msgid "ID" msgstr "ID" @@ -121,8 +132,9 @@ msgstr "Líneas de movimiento de Ubicación" #. module: stock_move_location #: model_terms:ir.ui.view,arch_db:stock_move_location.stock_picking_type_kanban +#, fuzzy msgid "Move On Hand" -msgstr "" +msgstr " Disponible" #. module: stock_move_location #: model:ir.actions.act_window,name:stock_move_location.wiz_stock_move_location_action @@ -131,7 +143,12 @@ msgid "Move from location..." msgstr "Mover desde ubicación..." #. module: stock_move_location -#: code:addons/stock_move_location/wizard/stock_move_location_line.py:65 +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__move_location_wizard_id +msgid "Move location Wizard" +msgstr "Asistente para mover desde ubicación" + +#. module: stock_move_location +#: code:addons/stock_move_location/wizard/stock_move_location_line.py:73 #, python-format msgid "Move quantity can not exceed max quantity or be negative" msgstr "La cantidad movida no puede superar la cantidad máxima o ser negativo" @@ -141,7 +158,7 @@ msgstr "La cantidad movida no puede superar la cantidad máxima o ser negativo" #, fuzzy #| msgid "Move from location..." msgid "Move to location..." -msgstr "Mover desde ubicación..." +msgstr "Mover desde otra ubicación" #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__origin_location_id @@ -154,7 +171,7 @@ msgstr "Ubicación de origen" #, fuzzy #| msgid "Origin Location" msgid "Origin Location Disable" -msgstr "Ubicación de origen" +msgstr "Origen" #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_stock_move__location_move @@ -165,7 +182,7 @@ msgstr "Parte de un movimiento entre ubicaciones" #: model:ir.model,name:stock_move_location.model_stock_picking_type #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__picking_type_id msgid "Picking Type" -msgstr "" +msgstr "Tipo de operación" #. module: stock_move_location #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location @@ -189,8 +206,9 @@ msgstr "Cantidad a mover" #. module: stock_move_location #: model:ir.model.fields,field_description:stock_move_location.field_stock_picking_type__show_move_onhand +#, fuzzy msgid "Show Move On hand stock" -msgstr "" +msgstr "Stock On Hand" #. module: stock_move_location #: model:ir.model.fields,help:stock_move_location.field_stock_picking_type__show_move_onhand @@ -219,14 +237,14 @@ msgstr "Si este movimiento es parte de movimiento de ubicaciones" #, fuzzy #| msgid "Part of move location" msgid "Wizard move location" -msgstr "Parte de un movimiento entre ubicaciones" +msgstr "Mover desde otra ubicación" #. module: stock_move_location #: model:ir.model,name:stock_move_location.model_wiz_stock_move_location_line #, fuzzy #| msgid "Move Location lines" msgid "Wizard move location line" -msgstr "Líneas de movimiento de Ubicación" +msgstr "Último movimiento" #. module: stock_move_location #: model:ir.model.fields,help:stock_move_location.field_wiz_stock_move_location__destination_location_disable @@ -244,9 +262,6 @@ msgstr "" #~ msgid "Clear all" #~ msgstr "Limpiar todo" -#~ msgid "Move location Wizard" -#~ msgstr "Asistente para mover desde ubicación" - #~ msgid "wiz.stock.move.location" #~ msgstr "wiz.stock.move.location" diff --git a/stock_move_location/i18n/stock_move_location.pot b/stock_move_location/i18n/stock_move_location.pot index 839240c9d..a18553868 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 12.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-02-03 17:13+0000\n" +"PO-Revision-Date: 2020-02-03 17:13+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -13,6 +15,16 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: stock_move_location +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__apply_putaway_strategy +msgid "Apply putaway strategy" +msgstr "" + +#. module: stock_move_location +#: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location +msgid "Apply putaway strategy for moving products" +msgstr "" + #. module: stock_move_location #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location msgid "Cancel" @@ -36,7 +48,7 @@ msgid "Created on" msgstr "" #. module: stock_move_location -#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__custom +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_custom msgid "Custom line" msgstr "" @@ -64,8 +76,8 @@ msgid "Edit Locations" 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 +#: 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 msgid "ID" msgstr "" @@ -124,7 +136,12 @@ msgid "Move from location..." msgstr "" #. module: stock_move_location -#: code:addons/stock_move_location/wizard/stock_move_location_line.py:65 +#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__move_location_wizard_id +msgid "Move location Wizard" +msgstr "" + +#. module: stock_move_location +#: code:addons/stock_move_location/wizard/stock_move_location_line.py:73 #, python-format msgid "Move quantity can not exceed max quantity or be negative" msgstr "" diff --git a/stock_move_location/tests/test_move_location.py b/stock_move_location/tests/test_move_location.py index 4c7f2bb60..79f6e7cee 100644 --- a/stock_move_location/tests/test_move_location.py +++ b/stock_move_location/tests/test_move_location.py @@ -123,6 +123,8 @@ class TestMoveLocation(TestsCommon): }) lines = wizard.stock_move_location_line_ids self.assertEqual(len(lines), 3) + wizard.onchange_origin_location() + self.assertEqual(len(lines), 3) wizard.destination_location_id = self.internal_loc_1 wizard._onchange_destination_location_id() self.assertEqual( diff --git a/stock_move_location/wizard/stock_move_location.py b/stock_move_location/wizard/stock_move_location.py index d7049fb63..04cabe3ca 100644 --- a/stock_move_location/wizard/stock_move_location.py +++ b/stock_move_location/wizard/stock_move_location.py @@ -42,6 +42,9 @@ class StockMoveLocationWizard(models.TransientModel): stock_move_location_line_ids = fields.Many2many( string="Move Location lines", comodel_name="wiz.stock.move.location.line", + column1="move_location_wiz_id", + column2="move_location_line_wiz_id", + ) picking_type_id = fields.Many2one( comodel_name='stock.picking.type', @@ -53,6 +56,9 @@ class StockMoveLocationWizard(models.TransientModel): ) edit_locations = fields.Boolean(string='Edit Locations', default=True) + apply_putaway_strategy = fields.Boolean( + string='Apply putaway strategy', + ) @api.depends('edit_locations') def _compute_readonly_locations(self): @@ -202,9 +208,10 @@ class StockMoveLocationWizard(models.TransientModel): for group in self._get_group_quants(): product = product_obj.browse(group.get("product_id")).exists() # Apply the putaway strategy - location_dest_id = \ - self.destination_location_id.get_putaway_strategy( - product).id or self.destination_location_id.id + location_dest_id = ( + self.apply_putaway_strategy and + self.destination_location_id.get_putaway_strategy(product).id + or self.destination_location_id.id) product_data.append({ 'product_id': product.id, 'move_quantity': group.get("sum"), @@ -220,8 +227,12 @@ class StockMoveLocationWizard(models.TransientModel): @api.onchange('origin_location_id') def onchange_origin_location(self): + # Get origin_location_disable context key to prevent load all origin + # location products when user opens the wizard from stock quants to + # move it to other location. lines = [] - if self.origin_location_id: + if (not self.env.context.get('origin_location_disable') and + self.origin_location_id): line_model = self.env["wiz.stock.move.location.line"] for line_val in self._get_stock_move_location_lines_values(): if line_val.get('max_quantity') <= 0: @@ -229,7 +240,6 @@ class StockMoveLocationWizard(models.TransientModel): line = line_model.create(line_val) line.max_quantity = line.get_max_quantity() lines.append(line) - # self.stock_move_location_line_ids = [(4, line.id)] self.update({'stock_move_location_line_ids': [ (6, 0, [line.id for line in lines])]}) diff --git a/stock_move_location/wizard/stock_move_location.xml b/stock_move_location/wizard/stock_move_location.xml index 1463380db..352e0817a 100755 --- a/stock_move_location/wizard/stock_move_location.xml +++ b/stock_move_location/wizard/stock_move_location.xml @@ -13,6 +13,12 @@ Edit Locations + +
+ +
diff --git a/stock_move_location/wizard/stock_move_location_line.py b/stock_move_location/wizard/stock_move_location_line.py index 6fc273a37..f6d70ce87 100644 --- a/stock_move_location/wizard/stock_move_location_line.py +++ b/stock_move_location/wizard/stock_move_location_line.py @@ -12,6 +12,13 @@ class StockMoveLocationWizardLine(models.TransientModel): _name = "wiz.stock.move.location.line" _description = 'Wizard move location line' + move_location_wizard_id = fields.Many2many( + string="Move location Wizard", + comodel_name="wiz.stock.move.location", + column1='move_location_line_wiz_id', + column2='move_location_wiz_id', + readonly=True, + ) product_id = fields.Many2one( string="Product", comodel_name="product.product", @@ -94,8 +101,10 @@ class StockMoveLocationWizardLine(models.TransientModel): @api.multi def _get_move_line_values(self, picking, move): self.ensure_one() - location_dest_id = self.destination_location_id.get_putaway_strategy( - self.product_id).id or self.destination_location_id.id + location_dest_id = ( + self.move_location_wizard_id.apply_putaway_strategy and + self.destination_location_id.get_putaway_strategy( + self.product_id).id or self.destination_location_id.id) qty_todo, qty_done = self._get_available_quantity() return { "product_id": self.product_id.id,