[IMP] stock_move_location: Allow to disable apply putaway strategy

This commit is contained in:
Sergio Teruel
2020-02-03 18:49:11 +01:00
parent 0a84e5bed3
commit c0f340bb3e
5 changed files with 67 additions and 15 deletions

View File

@@ -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:47+0000\n"
"PO-Revision-Date: 2020-02-03 18:48+0100\n"
"Last-Translator: Enric Tobella <etobella@creublanca.es>\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
@@ -68,7 +79,7 @@ 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
@@ -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
@@ -130,6 +142,11 @@ msgstr ""
msgid "Move from location..."
msgstr "Mover desde ubicación..."
#. module: stock_move_location
#: 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:0
#, python-format
@@ -164,8 +181,9 @@ msgstr "Parte de un movimiento entre ubicaciones"
#. module: stock_move_location
#: 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
#, fuzzy
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 +207,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 +238,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 "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 "Move Location lines"
msgid "Wizard move location line"
msgstr "Líneas de movimiento de Ubicación"
msgstr "Asistente para mover desde ubicación"
#. module: stock_move_location
#: model:ir.model.fields,help:stock_move_location.field_wiz_stock_move_location__destination_location_disable
@@ -244,9 +263,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"

View File

@@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-03 17:47+0000\n"
"PO-Revision-Date: 2020-02-03 17:47+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"
@@ -123,6 +135,11 @@ msgstr ""
msgid "Move from location..."
msgstr ""
#. module: stock_move_location
#: 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:0
#, python-format

View File

@@ -46,7 +46,10 @@ class StockMoveLocationWizard(models.TransientModel):
domain=lambda self: self._get_locations_domain(),
)
stock_move_location_line_ids = fields.Many2many(
string="Move Location lines", comodel_name="wiz.stock.move.location.line"
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", default=_get_default_picking_type_id
@@ -55,6 +58,7 @@ class StockMoveLocationWizard(models.TransientModel):
string="Connected Picking", comodel_name="stock.picking"
)
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):
@@ -206,7 +210,8 @@ class StockMoveLocationWizard(models.TransientModel):
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
self.apply_putaway_strategy
and self.destination_location_id.get_putaway_strategy(product).id
or self.destination_location_id.id
)
product_data.append(

View File

@@ -13,6 +13,12 @@
Edit Locations
</label>
<field name="edit_locations" widget="boolean_toggle"/>
</div>
<div groups="stock.group_stock_multi_locations">
<label for="apply_putaway_strategy">
Apply putaway strategy for moving products
</label>
<field name="apply_putaway_strategy" widget="boolean_toggle"/>
</div>
<group name="picking_type">
<field name="picking_type_id"/>

View File

@@ -11,6 +11,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", required=True
)
@@ -78,7 +85,8 @@ class StockMoveLocationWizardLine(models.TransientModel):
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
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()