Skip to content

Commit

Permalink
[MIG] shopfloor_delivery_shipment: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giarve committed Oct 29, 2024
1 parent 43fd13a commit 7356527
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 58 deletions.
10 changes: 5 additions & 5 deletions shopfloor_delivery_shipment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Shopfloor - Delivery with shipment advice
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwms-lightgray.png?logo=github
:target: https://github.com/OCA/wms/tree/14.0/shopfloor_delivery_shipment
:target: https://github.com/OCA/wms/tree/16.0/shopfloor_delivery_shipment
:alt: OCA/wms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor_delivery_shipment
:target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-shopfloor_delivery_shipment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/wms&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/wms&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -46,7 +46,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20shopfloor_delivery_shipment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20shopfloor_delivery_shipment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -101,6 +101,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sebalix| |maintainer-TDu|

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/shopfloor_delivery_shipment>`_ project on GitHub.
This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/16.0/shopfloor_delivery_shipment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion shopfloor_delivery_shipment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Shopfloor - Delivery with shipment advice",
"summary": "Manage delivery process with shipment advices",
"version": "14.0.1.4.2",
"version": "16.0.1.0.0",
"development_status": "Alpha",
"category": "Inventory",
"website": "https://github.com/OCA/wms",
Expand Down
120 changes: 80 additions & 40 deletions shopfloor_delivery_shipment/actions/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,91 +26,131 @@ def scan_dock_again_to_confirm(self, dock):
def picking_not_planned_in_shipment(self, picking, shipment_advice):
return {
"message_type": "error",
"body": _("Transfer {} has not been planned in the shipment {}.").format(
picking.name,
shipment_advice.name,
),
"body": _(
"Transfer %(picking_name)s has not been planned in the shipment "
"%(shipment_name)s."
)
% {
"picking_name": picking.name,
"shipment_name": shipment_advice.name,
},
}

def package_not_planned_in_shipment(self, package, shipment_advice):
return {
"message_type": "error",
"body": _("Package {} has not been planned in the shipment {}.").format(
package.name,
shipment_advice.name,
),
"body": _(
"Package %(package_name)s has not been planned in the shipment "
"%(shipment_name)s."
)
% {
"package_name": package.name,
"shipment_name": shipment_advice.name,
},
}

def lot_not_planned_in_shipment(self, lot, shipment_advice):
return {
"message_type": "error",
"body": _("Lot {} has not been planned in the shipment {}.").format(
lot.name,
shipment_advice.name,
),
"body": _(
"Lot %(lot_name)s has not been planned in the shipment "
"%(shipment_name)s."
)
% {
"lot_name": lot.name,
"shipment_name": shipment_advice.name,
},
}

def product_not_planned_in_shipment(self, product, shipment_advice):
return {
"message_type": "error",
"body": _("Product {} has not been planned in the shipment {}.").format(
product.barcode,
shipment_advice.name,
),
"body": _(
"Product %(product_barcode)s has not been planned in the shipment "
"%(shipment_name)s."
)
% {
"product_barcode": product.barcode,
"shipment_name": shipment_advice.name,
},
}

def unable_to_load_package_in_shipment(self, package, shipment_advice):
return {
"message_type": "error",
"body": _("Package {} can not been loaded in the shipment {}.").format(
package.name,
shipment_advice.name,
),
"body": _(
"Package %(package_name)s can not been loaded in the shipment "
"%(shipment_name)s."
)
% {
"package_name": package.name,
"shipment_name": shipment_advice.name,
},
}

def unable_to_load_lot_in_shipment(self, lot, shipment_advice):
return {
"message_type": "error",
"body": _("Lot {} can not been loaded in the shipment {}.").format(
lot.name,
shipment_advice.name,
),
"body": _(
"Lot %(lot_name)s can not been loaded in the shipment "
"%(shipment_name)s."
)
% {
"lot_name": lot.name,
"shipment_name": shipment_advice.name,
},
}

def unable_to_load_product_in_shipment(self, product, shipment_advice):
return {
"message_type": "error",
"body": _("Product {} can not been loaded in the shipment {}.").format(
product.barcode,
shipment_advice.name,
),
"body": _(
"Product %(product_barcode)s can not been loaded in the shipment "
"%(shipment_name)s."
)
% {
"product_barcode": product.barcode,
"shipment_name": shipment_advice.name,
},
}

def package_already_loaded_in_shipment(self, package, shipment_advice):
return {
"message_type": "warning",
"body": _("Package {} is already loaded in the shipment {}.").format(
package.name,
shipment_advice.name,
),
"body": _(
"Package %(package_name)s is already loaded in the shipment "
"%(shipment_name)s."
)
% {
"package_name": package.name,
"shipment_name": shipment_advice.name,
},
}

def lot_already_loaded_in_shipment(self, lot, shipment_advice):
return {
"message_type": "warning",
"body": _("Lot {} is already loaded in the shipment {}.").format(
lot.name,
shipment_advice.name,
),
"body": _(
"Lot %(lot_name)s is already loaded in the shipment "
"%(shipment_name)s."
)
% {
"lot_name": lot.name,
"shipment_name": shipment_advice.name,
},
}

def product_already_loaded_in_shipment(self, product, shipment_advice):
return {
"message_type": "warning",
"body": _("Product {} is already loaded in the shipment {}.").format(
product.name,
shipment_advice.name,
),
"body": _(
"Product %(product_name)s is already loaded in the shipment "
"%(shipment_name)s."
)
% {
"product_name": product.name,
"shipment_name": shipment_advice.name,
},
}

def carrier_not_allowed_by_shipment(self, picking):
Expand Down
18 changes: 10 additions & 8 deletions shopfloor_delivery_shipment/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Shopfloor - Delivery with shipment advice</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:92f864184d8b226015d3bf530f5fe6b5380037660e0bd2db36c22839cc32b24a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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_delivery_shipment"><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_delivery_shipment"><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><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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/16.0/shopfloor_delivery_shipment"><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-16-0/wms-16-0-shopfloor_delivery_shipment"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Shopfloor scenario to manage the delivery process based on shipment advices.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
Expand All @@ -396,7 +396,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/wms/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/wms/issues/new?body=module:%20shopfloor_delivery_shipment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/wms/issues/new?body=module:%20shopfloor_delivery_shipment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -431,13 +431,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/sebalix"><img alt="sebalix" src="https://github.com/sebalix.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/TDu"><img alt="TDu" src="https://github.com/TDu.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/wms/tree/14.0/shopfloor_delivery_shipment">OCA/wms</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/wms/tree/16.0/shopfloor_delivery_shipment">OCA/wms</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class DeliveryShipmentCommonCase(common.CommonCase):
@classmethod
def setUpClassVars(cls, *args, **kwargs):
super().setUpClassVars(*args, **kwargs)
result = super().setUpClassVars(*args, **kwargs)
cls.menu = cls.env.ref(
"shopfloor_delivery_shipment.shopfloor_menu_delivery_shipment"
)
Expand All @@ -20,10 +20,11 @@ def setUpClassVars(cls, *args, **kwargs):
cls.dock = cls.env.ref("shipment_advice.stock_dock_demo")
cls.dock.sudo().barcode = "DOCK"
cls.dock2 = cls.dock.sudo().copy({"barcode": "DOCK2"})
return result

@classmethod
def setUpClassBaseData(cls, *args, **kwargs):
super().setUpClassBaseData(*args, **kwargs)
result = super().setUpClassBaseData(*args, **kwargs)
# Create 3 deliveries
cls.product_c.tracking = "lot"
cls.pickings = cls.env["stock.picking"]
Expand Down Expand Up @@ -55,11 +56,13 @@ def setUpClassBaseData(cls, *args, **kwargs):
picking.action_assign()
# Create a shipment advice
cls.shipment = cls._create_shipment()
return result

@classmethod
def setUpShopfloorApp(cls):
super().setUpShopfloorApp()
result = super().setUpShopfloorApp()
cls.shopfloor_app.sudo().profile_ids += cls.profile
return result

def setUp(self):
super().setUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeliveryShipmentScanDocumentLocationCase(DeliveryShipmentCommonCase):

@classmethod
def setUpClassBaseData(cls, *args, **kwargs):
super().setUpClassBaseData(*args, **kwargs)
result = super().setUpClassBaseData(*args, **kwargs)
cls.location = cls.menu.picking_type_ids.default_location_src_id
cls.sublocation = cls.env.ref("stock.stock_location_14")
cls.badlocation = cls.env.ref("stock.stock_location_customers")
Expand All @@ -31,6 +31,8 @@ def setUpClassBaseData(cls, *args, **kwargs):
cls.pick_subloc.action_assign()
assert cls.pick_subloc.state == "assigned"

return result

def test_scan_document_location_ok_to_work_from(self):
"""Scan a location allowed per the menu transfer type."""
self._plan_records_in_shipment(self.shipment, self.picking1.move_lines)
Expand Down

0 comments on commit 7356527

Please sign in to comment.