[REF] mrp: move plan_from to a wizard

task-2241471
This commit is contained in:
Simon Lejeune
2020-06-15 16:59:41 +02:00
parent 421d2d21aa
commit b0a905a41d
2 changed files with 29 additions and 30 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ class MrpProduction(models.Model):
help="Date at which you plan to start the production.",
index=True, required=True, store=True)
date_planned_finished = fields.Datetime(
'Planned End Date',
'Scheduled End Date',
default=_get_default_date_planned_finished,
compute='_compute_dates_planned', inverse='_set_date_planned_finished',
help="Date at which you plan to finish the production.",
@@ -995,7 +995,7 @@ class MrpProduction(models.Model):
start_date = max(start_date, datetime.datetime.now())
workorder_ids.leave_id.unlink()
else:
workorder_ids = self.workorder_ids
workorder_ids = self.workorder_ids.filtered(lambda wo: not wo.date_planned_start)
for workorder in workorder_ids:
workcenters = workorder.workcenter_id | workorder.workcenter_id.alternative_workcenter_ids
+27 -28
View File
@@ -153,47 +153,46 @@
</group>
<group>
<field name="date_deadline" attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"/>
<div class="o_row o_td_label">
<div class="o_row o_td_label" attrs="{'invisible': [
'|',
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed', 'to_close'])
]}">
<label for="date_planned_start" string="Planned Date"
attrs="{'invisible': [
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed'])
]}"/>
<label for="date_planned_start" string="Plan from"
attrs="{'invisible': [
'|',
('bom_has_operations', '=', False),
('state', 'not in', ['draft', 'confirmed'])
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed', 'to_close'])
]}"/>
</div>
<div class="o_row">
<div class="o_row" attrs="{'invisible': [
'|',
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed', 'to_close'])
]}">
<field name="date_planned_start"
attrs="{'readonly': [
'|',
'&amp;',
('bom_has_operations', '=', False),
('state', 'in', ['done', 'cancel']),
'&amp;',
attrs="{'readonly': [
('bom_has_operations', '!=', False),
('state', 'not in', ['draft', 'confirmed', 'to_close'])],
'invisible': [
'|',
('bom_has_operations', '!=', False),
('state', 'not in', ['draft', 'confirmed'])]}"/>
('state', 'in', ['draft', 'confirmed', 'to_close'])]}"/>
<label for="date_planned_finished" string="to" attrs="{'invisible': [
'|',
('id', '=', False),
'&amp;',
'|',
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed'])
('state', 'in', ['draft', 'confirmed', 'to_close'])
]}"/>
<field name="date_planned_finished" required="1"
attrs="{'readonly': [
'|',
'&amp;',
('bom_has_operations', '=', False),
('state', 'in', ['done', 'cancel']),
('bom_has_operations', '!=', False)
], 'invisible': [
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed'])
]}"/>
attrs="{'readonly': [
('bom_has_operations', '!=', False)
], 'invisible': [
'|',
('bom_has_operations', '!=', False),
('state', 'in', ['draft', 'confirmed', 'to_close'])
]}"/>
<field name="delay_alert_date" invisible="1"/>
<field string=" " name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('delay_alert_date', '=', False)]}"/>
</div>