diff --git a/mrp_warehouse_calendar/README.rst b/mrp_warehouse_calendar/README.rst index 94c241132..ba4a35fa1 100644 --- a/mrp_warehouse_calendar/README.rst +++ b/mrp_warehouse_calendar/README.rst @@ -17,25 +17,26 @@ MRP Warehouse Calendar :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github - :target: https://github.com/OCA/manufacture/tree/17.0/mrp_warehouse_calendar + :target: https://github.com/OCA/manufacture/tree/18.0/mrp_warehouse_calendar :alt: OCA/manufacture .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/manufacture-17-0/manufacture-17-0-mrp_warehouse_calendar + :target: https://translation.odoo-community.org/projects/manufacture-18-0/manufacture-18-0-mrp_warehouse_calendar :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/manufacture&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -With this module the manufacturing orders created from procurements -consider the calendar assigned to the warehouse of the picking type of -the manufacturing order to determine, based on the product's -manufacturing lead time, the planned start date of the manufacturing -order. +This module ensures that manufacturing orders created from procurements +respect the calendar assigned to the warehouse associated with the +manufacturing order's picking type. The planned start date of the +manufacturing order is calculated based on the product's manufacturing +lead time and the working schedules defined in the warehouse calendar. -Further manual replannings of start/end date of the manufacturing order -also consider the lead time using the warehouse calendar days. +Additionally, any manual rescheduling of the start or end date of a +manufacturing order will also take the lead time into account, following +the working days defined by the warehouse calendar. **Table of contents** @@ -47,11 +48,15 @@ Configuration - This module depends on `stock_warehouse_calendar `__ -- Go to *Settings* and activate the developer mode. -- Go to *Settings > Technical > Resource > Working Time* and define - your resource calendar. +- Go to *Settings* and activate the developer mode. |Developer mode| +- Go to *Settings > Technical > Resource > Working Schedules* and + define your resource calendar. |Working Schedules| - Go to *Inventory > Configuration > Warehouse Management > Warehouses* - and assign the Resource Calendar. + and assign the Working Schedule. |Warehouse Management| + +.. |Developer mode| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/developer_mode.gif +.. |Working Schedules| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/working_schedules.gif +.. |Warehouse Management| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/warehouse_management.gif Usage ===== @@ -61,9 +66,19 @@ When a manufacturing order is created out of a procurement evaluation computation of the planned start date of the manufacturing order. For example, if it takes 1 day to manufacture a product and it is -required for Monday, the manufacturing order will be created with -planned start date on the previous Friday, if the warehouse operates -under a Mo-Fri working calendar. +required for Monday: |Replenish| + +the manufacturing order will be created with planned start date on the +previous Friday, if the warehouse operates under a Mo-Fri working +calendar. |Manufacturing Order| + +Manual changes to the start or end date of a manufacturing order will +also respect the lead time and the warehouse calendar's working days. +|Manual change day| + +.. |Replenish| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/replenish.png +.. |Manufacturing Order| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/manufacturing_order.png +.. |Manual change day| image:: https://raw.githubusercontent.com/OCA/manufacture/18.0/mrp_warehouse_calendar/static/description/change_day.gif Bug Tracker =========== @@ -71,7 +86,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -110,6 +125,6 @@ Current `maintainer `__: |maintainer-JordiBForgeFlow| -This module is part of the `OCA/manufacture `_ project on GitHub. +This module is part of the `OCA/manufacture `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_warehouse_calendar/__manifest__.py b/mrp_warehouse_calendar/__manifest__.py index 92e985aa4..f5ab1091f 100644 --- a/mrp_warehouse_calendar/__manifest__.py +++ b/mrp_warehouse_calendar/__manifest__.py @@ -4,7 +4,7 @@ { "name": "MRP Warehouse Calendar", "summary": "Considers the warehouse calendars in manufacturing", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/manufacture", "author": "ForgeFlow, Odoo Community Association (OCA)", diff --git a/mrp_warehouse_calendar/readme/CONFIGURE.md b/mrp_warehouse_calendar/readme/CONFIGURE.md index c4414f162..42d86a253 100644 --- a/mrp_warehouse_calendar/readme/CONFIGURE.md +++ b/mrp_warehouse_calendar/readme/CONFIGURE.md @@ -1,7 +1,10 @@ - This module depends on [stock_warehouse_calendar](https://github.com/OCA/stock-logistics-warehouse) - Go to *Settings* and activate the developer mode. -- Go to *Settings \> Technical \> Resource \> Working Time* and define +![Developer mode](../static/description/developer_mode.gif) +- Go to *Settings \> Technical \> Resource \> Working Schedules* and define your resource calendar. +![Working Schedules](../static/description/working_schedules.gif) - Go to *Inventory \> Configuration \> Warehouse Management \> - Warehouses* and assign the Resource Calendar. + Warehouses* and assign the Working Schedule. +![Warehouse Management](../static/description/warehouse_management.gif) diff --git a/mrp_warehouse_calendar/readme/DESCRIPTION.md b/mrp_warehouse_calendar/readme/DESCRIPTION.md index 100b2da2b..73681d7bd 100644 --- a/mrp_warehouse_calendar/readme/DESCRIPTION.md +++ b/mrp_warehouse_calendar/readme/DESCRIPTION.md @@ -1,8 +1,11 @@ -With this module the manufacturing orders created from procurements -consider the calendar assigned to the warehouse of the picking type of -the manufacturing order to determine, based on the product's -manufacturing lead time, the planned start date of the manufacturing -order. +This module ensures that manufacturing orders created from +procurements respect the calendar assigned to the warehouse +associated with the manufacturing order's picking type. +The planned start date of the manufacturing order is calculated +based on the product's manufacturing lead time and the working +schedules defined in the warehouse calendar. -Further manual replannings of start/end date of the manufacturing order -also consider the lead time using the warehouse calendar days. +Additionally, any manual rescheduling of the start or +end date of a manufacturing order will also take the lead +time into account, following the working days defined by +the warehouse calendar. diff --git a/mrp_warehouse_calendar/readme/USAGE.md b/mrp_warehouse_calendar/readme/USAGE.md index 238bc0c91..a6a39d575 100644 --- a/mrp_warehouse_calendar/readme/USAGE.md +++ b/mrp_warehouse_calendar/readme/USAGE.md @@ -3,6 +3,14 @@ When a manufacturing order is created out of a procurement evaluation computation of the planned start date of the manufacturing order. For example, if it takes 1 day to manufacture a product and it is -required for Monday, the manufacturing order will be created with +required for Monday: +![Replenish](../static/description/replenish.png) + +the manufacturing order will be created with planned start date on the previous Friday, if the warehouse operates under a Mo-Fri working calendar. +![Manufacturing Order](../static/description/manufacturing_order.png) + +Manual changes to the start or end date of a manufacturing order will +also respect the lead time and the warehouse calendar's working days. +![Manual change day](../static/description/change_day.gif) diff --git a/mrp_warehouse_calendar/static/description/change_day.gif b/mrp_warehouse_calendar/static/description/change_day.gif new file mode 100644 index 000000000..550ec4050 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/change_day.gif differ diff --git a/mrp_warehouse_calendar/static/description/developer_mode.gif b/mrp_warehouse_calendar/static/description/developer_mode.gif new file mode 100644 index 000000000..1c5760035 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/developer_mode.gif differ diff --git a/mrp_warehouse_calendar/static/description/index.html b/mrp_warehouse_calendar/static/description/index.html index 940978f72..4cf05b549 100644 --- a/mrp_warehouse_calendar/static/description/index.html +++ b/mrp_warehouse_calendar/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -: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. @@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { 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 } @@ -300,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,14 +369,15 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:18cdb9aea24afa77c86c9bf4c578ce490415389ba52053aabd18c04b457002eb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: LGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

-

With this module the manufacturing orders created from procurements -consider the calendar assigned to the warehouse of the picking type of -the manufacturing order to determine, based on the product’s -manufacturing lead time, the planned start date of the manufacturing -order.

-

Further manual replannings of start/end date of the manufacturing order -also consider the lead time using the warehouse calendar days.

+

Production/Stable License: LGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

+

This module ensures that manufacturing orders created from procurements +respect the calendar assigned to the warehouse associated with the +manufacturing order’s picking type. The planned start date of the +manufacturing order is calculated based on the product’s manufacturing +lead time and the working schedules defined in the warehouse calendar.

+

Additionally, any manual rescheduling of the start or end date of a +manufacturing order will also take the lead time into account, following +the working days defined by the warehouse calendar.

Table of contents

    @@ -395,11 +397,11 @@ also consider the lead time using the warehouse calendar days.

    • This module depends on stock_warehouse_calendar
    • -
    • Go to Settings and activate the developer mode.
    • -
    • Go to Settings > Technical > Resource > Working Time and define -your resource calendar.
    • +
    • Go to Settings and activate the developer mode. Developer mode
    • +
    • Go to Settings > Technical > Resource > Working Schedules and +define your resource calendar. Working Schedules
    • Go to Inventory > Configuration > Warehouse Management > Warehouses -and assign the Resource Calendar.
    • +and assign the Working Schedule. Warehouse Management
@@ -408,16 +410,20 @@ and assign the Resource Calendar. (from an orderpoint, MTO,…) the calendar is considered in the computation of the planned start date of the manufacturing order.

For example, if it takes 1 day to manufacture a product and it is -required for Monday, the manufacturing order will be created with -planned start date on the previous Friday, if the warehouse operates -under a Mo-Fri working calendar.

+required for Monday: Replenish

+

the manufacturing order will be created with planned start date on the +previous Friday, if the warehouse operates under a Mo-Fri working +calendar. Manufacturing Order

+

Manual changes to the start or end date of a manufacturing order will +also respect the lead time and the warehouse calendar’s working days. +Manual change day

Bug Tracker

Bugs are tracked on GitHub 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.

+feedback.

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

@@ -438,13 +444,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

Current maintainer:

JordiBForgeFlow

-

This module is part of the OCA/manufacture project on GitHub.

+

This module is part of the OCA/manufacture project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/mrp_warehouse_calendar/static/description/manufacturing_order.png b/mrp_warehouse_calendar/static/description/manufacturing_order.png new file mode 100644 index 000000000..dc7b42978 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/manufacturing_order.png differ diff --git a/mrp_warehouse_calendar/static/description/replenish.png b/mrp_warehouse_calendar/static/description/replenish.png new file mode 100644 index 000000000..d666d5cd0 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/replenish.png differ diff --git a/mrp_warehouse_calendar/static/description/warehouse_management.gif b/mrp_warehouse_calendar/static/description/warehouse_management.gif new file mode 100644 index 000000000..71b886f95 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/warehouse_management.gif differ diff --git a/mrp_warehouse_calendar/static/description/working_schedules.gif b/mrp_warehouse_calendar/static/description/working_schedules.gif new file mode 100644 index 000000000..b831bf2c1 Binary files /dev/null and b/mrp_warehouse_calendar/static/description/working_schedules.gif differ diff --git a/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py b/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py index 070db17df..f4551b471 100644 --- a/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py +++ b/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py @@ -27,11 +27,17 @@ class TestMrpWarehouseCalendar(TransactionCase): { "name": "test product", "default_code": "PRD", - "type": "product", + "type": "consu", + "is_storable": "True", } ) self.product_2 = self.env["product.product"].create( - {"name": "test product 2", "default_code": "PRD 2", "type": "product"} + { + "name": "test product 2", + "default_code": "PRD 2", + "type": "consu", + "is_storable": "True", + } ) self.bom = self.env["mrp.bom"].create( { @@ -50,8 +56,12 @@ class TestMrpWarehouseCalendar(TransactionCase): self.product.route_ids = [(6, 0, self.manufacture_route.ids)] def test_procurement_with_calendar(self): + """Ensure that the planned start date of the manufacturing order + respects the warehouse calendar. The planned procurement date is + during a working interval, and the manufacturing lead time should + adjust the start date accordingly.""" values = { - "date_planned": "2097-01-07 09:00:00", # Monday + "date_planned": "2097-01-07 09:00:00", # Monday inside working hours "warehouse_id": self.warehouse, "company_id": self.company, "rule_id": self.manufacture_route, @@ -80,10 +90,12 @@ class TestMrpWarehouseCalendar(TransactionCase): self.assertEqual(date_plan_start, friday) def test_procurement_with_calendar_02(self): - """Test procuring at the beginning of the day, with no work intervals - before.""" + """Verify that procurement respects the warehouse calendar + when the planned date is outside working hours. The planned + manufacturing order start date should be adjusted to the last + available working interval.""" values = { - "date_planned": "2097-01-07 01:00:00", # Monday + "date_planned": "2097-01-07 01:00:00", # Monday outside working hours "warehouse_id": self.warehouse, "company_id": self.company, "rule_id": self.manufacture_route, @@ -112,6 +124,10 @@ class TestMrpWarehouseCalendar(TransactionCase): self.assertEqual(date_plan_start, friday) def test_onchange_date_planned(self): + """Test the impact of changing the planned start date (`date_start`) + on the planned end date (`date_finished`) in a manufacturing order. + Verify that the system correctly computes the end date considering + the manufacturing lead time and the warehouse calendar.""" mo = self.env["mrp.production"].new( { "product_id": self.product.id,