From 54cbedeaf757ce20396ad1e2c1b8a4ab50576409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Fri, 10 Apr 2020 09:47:40 +0000 Subject: [PATCH] [IMP] mrp: convert note field of operation into text work instruction. The field note of mrp.routing.workcenter was not very usefull, and not appear in the workorder related to this operation. Sometime, we need to have a small description of the work to do for a opeartion in the WO, instead of a complet pdf or google slide. -> Convert the note field as a description of the job to do and add a "text" worksheet_type to select it, in the mrp.routing.workcenter and add the related field in the WO. Update the view of accordingly. -> (migration): The 'note' content remain the same, then migration is not needed. If the user change the worksheet_type into text, the "note" will be the previous "description". task-2196687 --- addons/mrp/models/mrp_routing.py | 6 +++--- addons/mrp/models/mrp_workorder.py | 1 + addons/mrp/views/mrp_routing_views.xml | 8 +++----- addons/mrp/views/mrp_workorder_views.xml | 7 ++++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/mrp/models/mrp_routing.py b/addons/mrp/models/mrp_routing.py index fa0a8abdb04..7b8f8bfd06b 100644 --- a/addons/mrp/models/mrp_routing.py +++ b/addons/mrp/models/mrp_routing.py @@ -46,16 +46,16 @@ class MrpRoutingWorkcenter(models.Model): index=True, ondelete='cascade', required=True, help="The routing contains all the Work Centers used and for how long. This will create work orders afterwards " "which alters the execution of the manufacturing order.") - note = fields.Text('Description') company_id = fields.Many2one( 'res.company', 'Company', readonly=True, related='routing_id.company_id', store=True) - worksheet = fields.Binary('PDF') worksheet_type = fields.Selection([ - ('pdf', 'PDF'), ('google_slide', 'Google Slide')], + ('pdf', 'PDF'), ('google_slide', 'Google Slide'), ('text', 'Text')], string="Work Sheet", default="pdf", help="Defines if you want to use a PDF or a Google Slide as work sheet." ) + note = fields.Text('Description', help="Text worksheet description") + worksheet = fields.Binary('PDF') worksheet_google_slide = fields.Char('Google Slide', help="Paste the url of your Google Slide. Make sure the access to the document is public.") time_mode = fields.Selection([ ('auto', 'Compute based on real time'), diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index 0863d31ffa9..444976ebaed 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -110,6 +110,7 @@ class MrpWorkorder(models.Model): string='Worksheet Type', related='operation_id.worksheet_type', readonly=True) worksheet_google_slide = fields.Char( 'Worksheet URL', related='operation_id.worksheet_google_slide', readonly=True) + operation_note = fields.Text("Description", related='operation_id.note', readonly=True) move_raw_ids = fields.One2many( 'stock.move', 'workorder_id', 'Raw Moves', domain=[('raw_material_production_id', '!=', False), ('production_id', '=', False)]) diff --git a/addons/mrp/views/mrp_routing_views.xml b/addons/mrp/views/mrp_routing_views.xml index 20f998e4632..eeb55498856 100644 --- a/addons/mrp/views/mrp_routing_views.xml +++ b/addons/mrp/views/mrp_routing_views.xml @@ -49,14 +49,12 @@ - - - - - + + + diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml index 7a5dc3bdba3..b70d7625e21 100644 --- a/addons/mrp/views/mrp_workorder_views.xml +++ b/addons/mrp/views/mrp_workorder_views.xml @@ -224,10 +224,11 @@ - + - - + + +