Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
899 Lượt xem

Hi,

We're using V17e on prem.

I was wondering if there was a way to prevent Manufacturing orders / work orders being planned during the off hours of the work centers' schedules.

Our processes have to be completed in one go, without any break during runs.

Exemple of what Odoo is currently planning:

The wanted behavior would be for USINE/MO/28859 to be delayed until 8AM instead of starting the day before then having to stop for the night.

The work center is configured with a working hours schedule.

Is there any way to achieve the wanted behavior in vanilla Odoo?

Ảnh đại diện
Huỷ bỏ

I believe the only way is to manually plan the manufacturing orders. 
By default, almost all systems will begin one MO after another.

Câu trả lời hay nhất

To prevent Manufacturing Orders (MOs) or Work Orders from being scheduled during off-hours in Odoo (v17e) and ensure that operations respect the work center's defined working hours, follow these steps:

1. Understand the Issue

Odoo’s default planning engine for MOs and Work Orders tries to optimize for the earliest available start time. However, it does not automatically restrict operations to occur only within a work center’s scheduled hours unless additional configuration or logic is applied.

2. Configure Work Center Operating Hours

  1. Set Work Center Working Hours:
    • Navigate to Manufacturing > Configuration > Work Centers.
    • Select the work center (e.g., USINE).
    • Under the Working Hours field, assign the correct schedule (e.g., 8 AM to 5 PM).
  2. Verify the Schedule:
    • Go to Settings > Technical > Resources > Working Hours.
    • Check that the working hours (e.g., 8 AM - 5 PM) and breaks (if any) are correctly defined.

3. Use the "One Work Order at a Time" Option

  1. Configure Work Center Rules:
    • Open the work center configuration and enable One Work Order at a Time.
    • This ensures that only one work order is scheduled in the work center at a time, preventing overlapping jobs.
  2. Ensure Capacity and Duration Align:
    • For each manufacturing process, check that the duration of operations matches the work center’s schedule.
    • Navigate to Manufacturing > Configuration > Operations and adjust the operation times if necessary.

4. Use the "Scheduling with Constraints" Feature

Odoo Enterprise includes tools to handle constraints in scheduling.

  1. Enable Advanced Planning Options:
    • Navigate to Settings > Manufacturing.
    • Enable Work Order Dependencies or Planning by Work Centers if they aren’t already enabled.
  2. Ensure Dependencies are Correctly Configured:
    • For each operation, set up dependencies to ensure proper sequencing.
    • Go to the Bill of Materials (BoM) and define the dependencies in the Operations tab.
  3. Configure Work Center Schedules in Operations:
    • In the Routing linked to your BoM, ensure the work center’s schedule is assigned.

5. Automatically Adjust Planning to Working Hours

Odoo's planning logic might require adjustments to prevent jobs from being split across off-hours. You can achieve this in one of two ways:

Option A: Manual Adjustment

  • Use the Gantt view in the Manufacturing module:
    • Navigate to Manufacturing > Planning > Work Centers.
    • Drag and drop operations to align with work center hours.

Option B: Customization (Automated Adjustment)

  • Use Python and Odoo Studio to create logic that prevents MOs from being scheduled outside working hours. Here’s an example:
Python Code:
from odoo import models, fields, api
from datetime import timedelta

class MrpWorkOrder(models.Model):
    _inherit = 'mrp.workorder'

    @api.model
    def schedule_with_working_hours(self):
        for workorder in self:
            work_center = workorder.workcenter_id
            working_hours = work_center.resource_calendar_id
            planned_start = workorder.date_planned_start

            # Adjust start time to align with work center working hours
            if not working_hours.is_work_time(planned_start):
                next_work_time = working_hours.plan_hours(0, planned_start)
                workorder.date_planned_start = next_work_time
                workorder.date_planned_finished = next_work_time + timedelta(hours=workorder.duration_expected)
  • This logic checks if the planned start time aligns with working hours. If not, it shifts the start time to the next available working hour.

6. Test the Setup

  1. Create a New MO:
    • Ensure that the work order is planned within the configured work center hours.
    • If using customizations, verify that the MOs adjust automatically to fit working hours.
  2. Simulate Edge Cases:
    • Test scenarios where the operation duration exceeds the remaining working hours in the day.
    • Confirm that Odoo schedules the next part of the operation to the following working day.

7. Conclusion

In vanilla Odoo, while some adjustments can be made using configurations like working hours, dependencies, and the Gantt view, full automation of this behavior might require minor customization. Using the provided solutions, you can:

  1. Restrict scheduling to work center hours.
  2. Adjust the planning logic manually or automatically to align with defined schedules.

Let me know if you'd like further assistance with implementing any of these configurations or customizations!

Ảnh đại diện
Huỷ bỏ

Hey Gracious,

I was reviewing this forum post for a client of mine and I noticed something in your solution that I cannot find.

You mention, "Open the work center configuration and enable One Work Order at a Time." However, this is not a configuration that exists on the work center level. Can you please throw some light on this particular setting?

Hey! Good catch — and you're absolutely right to question that.

The setting "One Work Order at a Time" is not located on the Work Center form directly, but rather it's a configuration that applies to Routing Operations, and it depends on the version of Odoo you're working with.

Here's the breakdown:

In Odoo 15+:

The "One Work Order at a Time" checkbox is indeed part of the Routing Operation, not the Work Center.

To find it:

1. Go to Manufacturing > Configuration > Operations > Routings (Make sure Developer Mode is ON).

2. Open a Routing and check the Operations under it.

3. In each operation line, there will be a checkbox labeled “One Work Order at a Time”.

4. That setting prevents Odoo from scheduling multiple work orders for that operation simultaneously at the same work center.

It’s easy to assume it’s a Work Center setting because it’s tightly linked with how Work Orders get scheduled, but the actual constraint is enforced at the routing operation level.

---

Additional Tip:

If your client wants to enforce this across the board for a specific Work Center, you’d have to manually or programmatically ensure that all routing operations using that Work Center have this box checked.

Thanks for the response, Gracious!

I know what you are referring to, but Routings is no longer part of Oodo manufacturing. That was something we had in v14, and we are currently in v18 with v19 releasing later this year. Instead of routings, you directly assign Operations to BOMs, with each Operation being tied to a Work Center. We don't do it through routings anymore.

Looks like this "One Work order at a time" is also done away with because I cannot find the field in the list of fields under technical settings. I assumed your answer was on the latest version since it was posted a couple of months back, but as I understand it, this is the workflow for versions prior to v15.

Please feel free to correct me if I'm wrong. Thanks!

Hey! You're absolutely right—and you nailed the key differences across the versions. 👏

You're spot on that Routings were deprecated after v14, and since Odoo 15, the manufacturing flow was simplified. Now, Operations are directly tied to the Bill of Materials (BoM) and each Operation specifies its own Work Center, making it easier to manage and visualize the production flow without relying on a separate Routing object.

So yes—no more Routings as standalone entities from v15 onwards. The BoM now contains the Operations directly, and those Operations are fully configurable, including:

Work Center assignment

Duration computations

Operator tracking

Subcontracting options (if enabled)

Regarding “One Work Order at a Time”:
You’re again correct that the "One Work Order at a Time" field, which used to exist on the Work Center model (mrp.workcenter) to enforce serialized production, is no longer present in the interface or model as of v18.

This field was useful in older versions when companies wanted to avoid overlapping work orders on the same Work Center. In the modern flow:

Odoo instead relies more on Scheduling Conflicts, Capacity Planning, and Work Center Capacity (Number of units per cycle, time per unit, etc.).

To control concurrency, you're expected to manage this either through Work Center capacity settings or custom logic if you want serialized work order handling.

For v18+ Alternatives:
If you need to enforce "one work order at a time" behavior, a couple of options exist:

Set the Work Center Capacity to 1:

Go to the Work Center

Set Capacity to 1

This way, even though the field is gone, scheduling will naturally space work orders sequentially.

Customize Work Center Behavior via Studio or Code:

Add a constraint on scheduling work orders in custom logic

Example: block scheduling if a WO is already running on that Work Center.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 25
128
2
thg 6 23
1793
0
thg 12 21
1597
1
thg 8 24
2203
2
thg 8 24
712