Nathan Marotte (nama) 58d0db2017 [FIX] mrp : wrong expected duration in WC with capacity
Issue: In work centers with a capacity different than 1, the expected
duration was wrongly computed

Steps to reproduce :
 1) Install Manufacture, enable Work Centers in Settings
 2) Create a Work Center, Capacity = 2
 3) Create a Product, with Manufacture as route
 4) Create a Bill of Material :
   Add any component
   Add a operation line :
     Work Center = created at 2)
     Duration Computation = based on tracked time last 1 WO
 5) Create a Manufacturing Order for the product 3), confirm
 6) Set the real duration to 00:10, mark as done
 7) Check the BoM Structure & Cost of the BoM 4)
 -> Operations is 00:20

Why is that a bug:
 To compute the expected duration, in mrp_workorder.py L691 we already
 take into consideration the capacity of the work center.
 When computing the time_cycle, we must give a time_cycle for 1 product
 made with capacity 1, so we must first normalize the qty_produced fetch
  from the DB to make like if we only produced the quantity once but in
  the same amount of time

Side-Note: This also solves an issue with the Duration Computation based
 on tracked time. The `limit` keyword was applied after the `group by`
 so we effectively grouped all the operation_ids together, summing
 their quantities and then limiting on the different operation_ids

opw-2562983

closes odoo/odoo#75557

X-original-commit: c78a25f92716bd6014de381c34f3bc268d1528ae
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
2021-08-27 08:27:44 +00:00
2021-08-16 15:19:30 +00:00
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%