Set Custom Period to Forecast on Master Production Schedule in Odoo

Read Time:3 Minute, 42 Second

The Master Production Schedule in Odoo efficiently lets you plan your production based on your demand forecast. It comes as a big relief for the manufacturers dealing with bulk production.

Generally, when users enable the Odoo MPS function, they can set a time range as Monthly/Weekly/Daily to derive the forecast demand.

The only hurdle was that if the user wanted to derive forecast demand based on the historic data for a custom period like fifteen days of the month or three weeks, it wasn’t possible in default Odoo flow.

Recommended: Avoid decreased stockouts or excess inventory with custom Odoo Forecasted Quantity Report

How to select a custom period to forecast in Odoo 14 MPS?

Odoo 14 MPS doesn’t have the facility of fetching forecast demand based on a custom period to forecast, so we customized the flow wherein users can set custom- “Period to Forecast” and “Historic Data for Forecasting” as per their requirement.

Period to Forecast: the future duration you want the production demand.

Historic Data for forecasting: data that reveals the actual production demand for the selected timeline from the past.

Before moving ahead to the functionality, let’s get the configuration right:

Go to Master Production Schedule in Odoo Manufacturing module.
Select the time frame for MPS that is available by default in Odoo.
Master Production Schedule in Odoo
Based on the selected time frame, i.e., “Weekly” in the given case, one can set a custom period to forecast in the next step.
Checkbox for: “Period to forecast” and “Historic Data for Forecasting” is available under “Forecasted Demand on MPS.”

As per the selected MPS, i.e., weekly, users can set custom weeks for both period to forecast and historic data for forecasting.
In the given case, let’s say a user wants to generate forecast demand for the upcoming 14 weeks as compared to the historic data of 4 weeks.
Restraints Validation on the input field:

Field: For Historic Data field value cannot be smaller than res.config.settings.manufacturing_period (days < weeks sets how many periods need to be forecasted
Goal: have a list of dates to forecast.
Calculate history_start_date: today minus range defined in “Historic data for forecasting.”
Iterate loop for every product which is available in the master production schedule.
For each product, iterate over all forecast_dates (today date minus Historic data for forecasting from configuration).
For each forecast_date check total consumption of product per day where date.iso_weekday = forecast_date.iso_weekday and date >= history_start_date (For setting “days” only)

In short, the custom logic will check the past sale orders of selected products for a given duration between start date and end date and stock.move which are created during that period and prepare the dataset which shows day/week/month wise product quantity.

Put values that we have fetched from historical date and quantity into a list and use linear regression to find the value for the next dataset like below:

E.g: [{‘forecast_date’: total consumption}]

[{’08-12-2021′ : 10}, {’09-12-2021′ : 10}, {’10-12-2021′ : 10}, {’11-12-2021′ : 10}, {’12-12-2021′ : 10}, {’13-12-2021′ : 10}, {’14-12-2021′ : 10},]

The calculated value is then set as “Forecasted Demand” for the product on this Forecast Date.

Master Production Schedule in Odoo
Note: For different time ranges configured in the settings, we have used different ways of calculation:

Historic: days/Forecast days:

Total consumption on same weekdays
Each new forecast date has completed a new list of data values
When forecasting more than one week: forecasted demand values are counted as data points for linear regression

Historic: weeks/Forecast days:
Same as Days/Days

Historic: Weeks/Forecast: Weeks:
Forecast_dates = weeks; this week is number one

One dataset of history values
Total consumption over whole weeks as data values
Forecasted values become part of the dataset for the following value to forecast

Historic: Months/Forecast: Days:
Same as other day calculation

Historic: Months/Forecast: Weeks:
Same as Weeks/weeks

Historic: Months/Forecast: Months
Forecast_dates = months
One dataset of history values
Total consumption over a whole month as data values
Forecasted values become part of the dataset for the next value to forecast

Schedule a live demo with our technical experts and know more about the custom feature. Our team consists of all-rounding experts in Odoo apps; submit your requirements, if any.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published.

Trizetto Previous post Complete Trizetto Login Gateway Provider Login Guide
Next post Send Gifts for Mother to Mumbai