[REM] mrp: remove unused fields of workorder
Remove color and capacity fields of mpr.workorder unused
and coming from commit : 2ddc35a530 .
closes odoo/odoo#42498
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -790,7 +790,6 @@ class MrpProduction(models.Model):
|
||||
best_workcenter = workcenter
|
||||
vals = {
|
||||
'workcenter_id': workcenter.id,
|
||||
'capacity': workcenter.capacity,
|
||||
'duration_expected': duration_expected,
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
from datetime import datetime, timedelta
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from collections import defaultdict
|
||||
from math import floor
|
||||
import json
|
||||
|
||||
from odoo import api, fields, models, _, SUPERUSER_ID
|
||||
@@ -135,10 +134,6 @@ class MrpWorkorder(models.Model):
|
||||
scrap_ids = fields.One2many('stock.scrap', 'workorder_id')
|
||||
scrap_count = fields.Integer(compute='_compute_scrap_move_count', string='Scrap Move')
|
||||
production_date = fields.Datetime('Production Date', related='production_id.date_planned_start', store=True, readonly=False)
|
||||
color = fields.Integer('Color', compute='_compute_color')
|
||||
capacity = fields.Float(
|
||||
'Capacity', default=1.0,
|
||||
help="Number of pieces that can be produced in parallel.")
|
||||
raw_workorder_line_ids = fields.One2many('mrp.workorder.line',
|
||||
'raw_workorder_id', string='Components')
|
||||
finished_workorder_line_ids = fields.One2many('mrp.workorder.line',
|
||||
@@ -342,16 +337,6 @@ class MrpWorkorder(models.Model):
|
||||
for workorder in self:
|
||||
workorder.scrap_count = count_data.get(workorder.id, 0)
|
||||
|
||||
@api.depends('date_planned_finished', 'production_id.date_planned_finished')
|
||||
def _compute_color(self):
|
||||
late_orders = self.filtered(lambda x: x.production_id.date_planned_finished
|
||||
and x.date_planned_finished
|
||||
and x.date_planned_finished > x.production_id.date_planned_finished)
|
||||
for order in late_orders:
|
||||
order.color = 4
|
||||
for order in (self - late_orders):
|
||||
order.color = 2
|
||||
|
||||
@api.onchange('date_planned_start', 'duration_expected')
|
||||
def _onchange_date_planned_start(self):
|
||||
if self.date_planned_start and self.duration_expected:
|
||||
|
||||
Reference in New Issue
Block a user