diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2020-08-20 06:29:15 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2020-08-20 06:57:19 +0000 |
| commit | 4029b84be80a923c4c2cc157bf625b9ba06c0dc2 (patch) | |
| tree | 9af65416135be35960409a3818cbc1053d9f58b1 | |
| parent | 400d14a762ef327cf63f8b62b1c95497594616dc (diff) | |
[FIX] mrp: keep the default of expected duration
Issue: when we created a new operation from the MO form,
the default of the expected_duration wasn't take in account and
override to 0.0.
Fix: in `_get_duration_expected` If there isn't workcenter is set,
instead of return False, return the `duration_expected`
closes odoo/odoo#56127
Related: odoo/enterprise#12517
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
| -rw-r--r-- | addons/mrp/models/mrp_workorder.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index 7e87f300e16..ad6f91f263a 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -666,7 +666,7 @@ class MrpWorkorder(models.Model): def _get_duration_expected(self, alternative_workcenter=False, ratio=1): self.ensure_one() if not self.workcenter_id: - return False + return self.duration_expected if not self.operation_id: duration_expected_working = (self.duration_expected - self.workcenter_id.time_start - self.workcenter_id.time_stop) * self.workcenter_id.time_efficiency / 100.0 if duration_expected_working < 0: |
