Skip to content

Commit

Permalink
Merge commit 'refs/pull/775/head' of github.com:OCA/wms into merge-br…
Browse files Browse the repository at this point in the history
…anch-2477-BSCOS-4099-10871866
  • Loading branch information
sebalix committed Nov 13, 2023
2 parents c3177ba + e08ad60 commit a1b336a
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ addon | version | maintainers | summary
[sale_stock_available_to_promise_release](sale_stock_available_to_promise_release/) | 14.0.1.1.1 | | Integration between Sales and Available to Promise Release
[sale_stock_available_to_promise_release_cutoff](sale_stock_available_to_promise_release_cutoff/) | 14.0.1.1.1 | | Cutoff management with respect to stock availability
[sale_stock_available_to_promise_release_dropshipping](sale_stock_available_to_promise_release_dropshipping/) | 14.0.1.0.0 | | Glue module between sale_stock_available_to_promise_release and stock_dropshipping
[shopfloor](shopfloor/) | 14.0.4.3.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | manage warehouse operations with barcode scanners
[shopfloor](shopfloor/) | 14.0.4.3.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | manage warehouse operations with barcode scanners
[shopfloor_base](shopfloor_base/) | 14.0.2.10.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | Core module for creating mobile apps
[shopfloor_base_multicompany](shopfloor_base_multicompany/) | 14.0.1.0.0 | | Provide multi-company support and validation to Shopfloor applications.
[shopfloor_batch_automatic_creation](shopfloor_batch_automatic_creation/) | 14.0.1.2.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Create batch transfers for Cluster Picking
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Shopfloor
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2910a8caf5e806e221d07da7125a7d9777cc8be0617d421ecb30da9776e190c0
!! source digest: sha256:b2c51fbfe37b326cc86b4856116825c4ccc2692b607ab630ac8e5a1e0baf5173
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Shopfloor",
"summary": "manage warehouse operations with barcode scanners",
"version": "14.0.4.3.0",
"version": "14.0.4.4.0",
"development_status": "Beta",
"category": "Inventory",
"website": "https://github.com/OCA/wms",
Expand Down
3 changes: 2 additions & 1 deletion shopfloor/data/shopfloor_scenario_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"no_prefill_qty": true,
"show_oneline_package_content": true,
"auto_post_line": true,
"scan_location_or_pack_first": true
"scan_location_or_pack_first": true,
"ask_for_leaf_destination_location" : true
}
</field>
</record>
Expand Down
4 changes: 2 additions & 2 deletions shopfloor/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-29 08:27+0000\n"
"PO-Revision-Date: 2023-11-12 17:37+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
Expand Down Expand Up @@ -1020,7 +1020,7 @@ msgstr "Imballo non trovato nel trasferimento attuale."
#: code:addons/shopfloor/actions/message.py:0
#, python-format
msgid "Packaging {} dimension updated."
msgstr ""
msgstr "Dimensione imballo {} aggiornata."

#. module: shopfloor
#: code:addons/shopfloor/actions/message.py:0
Expand Down
41 changes: 41 additions & 0 deletions shopfloor/migrations/14.0.4.4.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2023 Camptocamp SA (http://www.camptocamp.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import json
import logging

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)


def migrate(cr, version):
if not version:
return
env = api.Environment(cr, SUPERUSER_ID, {})
checkout_scenario = env["shopfloor.scenario"].search([("key", "=", "checkout")])
_update_scenario_options(checkout_scenario)
checkout_menus = env["shopfloor.menu"].search(
[("scenario_id", "=", checkout_scenario.id)]
)
_enable_option_in_menus(checkout_menus)


def _update_scenario_options(scenario):
options = scenario.options
options["ask_for_leaf_destination_location"] = True
options_edit = json.dumps(options or {}, indent=4, sort_keys=True)
scenario.write({"options_edit": options_edit})
_logger.info(
"Option ask_for_leaf_destination_location added to the Checkout scenario"
)


def _enable_option_in_menus(menus):
for menu in menus:
menu.ask_for_leaf_destination_location = True
_logger.info(
"Option ask_for_leaf_destination_location enabled for menu {}".format(
menu.name
)
)
20 changes: 20 additions & 0 deletions shopfloor/models/shopfloor_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
to scan a destination package.
"""

ASK_FOR_LEAF_DESTINATION_LOCATION_HELP = """
When enabled, the destination location must be a leaf (location with no children)
location, if it is not, ask for scanning a child location of the destination.
"""


class ShopfloorMenu(models.Model):
_inherit = "shopfloor.menu"
Expand Down Expand Up @@ -226,6 +231,14 @@ class ShopfloorMenu(models.Model):
allow_alternative_destination_package_is_possible = fields.Boolean(
compute="_compute_allow_alternative_destination_package_is_possible"
)
ask_for_leaf_destination_location = fields.Boolean(
string="Ask for leaf destination location",
default=False,
help=ASK_FOR_LEAF_DESTINATION_LOCATION_HELP,
)
ask_for_leaf_destination_location_is_possible = fields.Boolean(
compute="_compute_ask_for_leaf_destination_location_is_possible"
)

@api.onchange("unload_package_at_destination")
def _onchange_unload_package_at_destination(self):
Expand Down Expand Up @@ -455,3 +468,10 @@ def _compute_allow_alternative_destination_package_is_possible(self):
menu.allow_alternative_destination_package_is_possible = (
menu.scenario_id.has_option("allow_alternative_destination_package")
)

@api.depends("scenario_id")
def _compute_ask_for_leaf_destination_location_is_possible(self):
for menu in self:
menu.ask_for_leaf_destination_location_is_possible = (
menu.scenario_id.has_option("ask_for_leaf_destination_location")
)
18 changes: 11 additions & 7 deletions shopfloor/services/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,10 @@ def no_package(self, picking_id, selected_line_ids):
if message:
return self._response_for_select_document(message=message)
selected_lines = self.env["stock.move.line"].browse(selected_line_ids).exists()
selected_lines.write(
selected_lines_with_qty_done = selected_lines.filtered(
lambda line: line.qty_done > 0
)
selected_lines_with_qty_done.write(
{"shopfloor_checkout_done": True, "result_package_id": False}
)
response = self._check_allowed_qty_done(picking, selected_lines)
Expand Down Expand Up @@ -1474,13 +1477,14 @@ def done(self, picking_id, confirmation=False):
)
lines_done = self._lines_checkout_done(picking)
dest_location = picking.location_dest_id
child_locations = self.env["stock.location"].search(
[("id", "child_of", dest_location.id), ("usage", "!=", "view")]
)
if len(child_locations) > 0 and child_locations != dest_location:
return self._response_for_select_child_location(
picking,
if self.work.menu.ask_for_leaf_destination_location:
child_locations = self.env["stock.location"].search(
[("id", "child_of", dest_location.id), ("usage", "!=", "view")]
)
if len(child_locations) > 0 and child_locations != dest_location:
return self._response_for_select_child_location(
picking,
)
stock = self._actions_for("stock")
stock.validate_moves(lines_done.move_id)
return self._response_for_select_document(
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Shopfloor</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2910a8caf5e806e221d07da7125a7d9777cc8be0617d421ecb30da9776e190c0
!! source digest: sha256:b2c51fbfe37b326cc86b4856116825c4ccc2692b607ab630ac8e5a1e0baf5173
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/wms/tree/14.0/shopfloor"><img alt="OCA/wms" src="https://img.shields.io/badge/github-OCA%2Fwms-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/wms&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Shopfloor is a barcode scanner application for internal warehouse operations.</p>
Expand Down
17 changes: 17 additions & 0 deletions shopfloor/tests/test_checkout_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,28 @@ def test_done_partial(self):
)

def test_done_partial_confirm(self):
"""Check confirm partially done no check for leaf location."""
# lines are done
response = self.service.dispatch(
"done", params={"picking_id": self.picking.id, "confirmation": True}
)

self.assertRecordValues(self.picking, [{"state": "done"}])

self.assert_response(
response,
next_state="select_document",
message=self.service.msg_store.transfer_done_success(self.picking),
data={"restrict_scan_first": False},
)

def test_done_partial_confirm_ask_leaf_location(self):
"""Check confirm partially done with force leaf location option on."""
self.menu.sudo().ask_for_leaf_destination_location = True
response = self.service.dispatch(
"done", params={"picking_id": self.picking.id, "confirmation": True}
)

self.assertRecordValues(self.picking, [{"state": "assigned"}])

self.assert_response(
Expand Down
10 changes: 10 additions & 0 deletions shopfloor/views/shopfloor_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@
/>
<field name="allow_alternative_destination_package" />
</group>
<group
name="ask_for_leaf_destination_location"
attrs="{'invisible': [('ask_for_leaf_destination_location_is_possible', '=', False)]}"
>
<field
name="ask_for_leaf_destination_location_is_possible"
invisible="1"
/>
<field name="ask_for_leaf_destination_location" />
</group>
</group>
</field>
</record>
Expand Down
18 changes: 11 additions & 7 deletions shopfloor_reception_packaging_dimension/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,51 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"PO-Revision-Date: 2023-11-12 17:37+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__display_name
msgid "Display Name"
msgstr ""
msgstr "Nome visualizzato"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__id
msgid "ID"
msgstr ""
msgstr "ID"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid ""
"If for the product being processed, its related packaging dimension are not "
"set, ask to fill them up."
msgstr ""
"Se per il prodotto che deve essere lavorato, non è impostata la dimensione "
"dell'imballo, chiede di compilarla."

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu____last_update
msgid "Last Modified on"
msgstr ""
msgstr "Ultima modifica il"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu
msgid "Menu displayed in the scanner application"
msgstr ""
msgstr "Menu visualizzato nell'applicazione di scansione"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension_is_possible
msgid "Set Packaging Dimension Is Possible"
msgstr ""
msgstr "È possibile impostare la dimensione dell'imballo"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid "Set packaging dimension"
msgstr ""
msgstr "Imposta dimensione imballo"
6 changes: 3 additions & 3 deletions stock_dynamic_routing/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-29 08:27+0000\n"
"PO-Revision-Date: 2023-11-12 17:37+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
Expand Down Expand Up @@ -122,12 +122,12 @@ msgstr "Instradamento dinamico"
#. module: stock_dynamic_routing
#: model:stock.picking.type,name:stock_dynamic_routing.stock_picking_type_handover_to_highbay_demo
msgid "Handover → Highbay"
msgstr ""
msgstr "Trasferimento → Scaffale"

#. module: stock_dynamic_routing
#: model:stock.picking.type,name:stock_dynamic_routing.stock_picking_type_highbay_to_handover_demo
msgid "Highbay → Handover"
msgstr ""
msgstr "Scaffale → Trasferimento"

#. module: stock_dynamic_routing
#: model:ir.model.fields,field_description:stock_dynamic_routing.field_stock_location__id
Expand Down

0 comments on commit a1b336a

Please sign in to comment.