From e25b9c9ffa67f0a70414a7a17c7b91557dce6bba Mon Sep 17 00:00:00 2001 From: Darshil Trivedi Date: Mon, 27 Aug 2018 05:10:11 +0000 Subject: [PATCH 1/2] [IMP] mrp: unbuild tooltips and fields label rename The purpose is to help the user if he has difficulties to know the purpose of a field. The field for tracking was named lot but it is also used for serial number. That could be confusing for the end user. Also rename source as source location in order to be coherent with destination location This commit is related to task ID 39843. --- addons/mrp/models/mrp_unbuild.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py index 7ee94a3af71..e33e0dfbea5 100644 --- a/addons/mrp/models/mrp_unbuild.py +++ b/addons/mrp/models/mrp_unbuild.py @@ -37,18 +37,18 @@ class MrpUnbuild(models.Model): domain="[('product_id', '=', product_id), ('state', 'in', ['done', 'cancel'])]", states={'done': [('readonly', True)]}) lot_id = fields.Many2one( - 'stock.production.lot', 'Lot', + 'stock.production.lot', 'Lot/Serial Number', domain="[('product_id', '=', product_id)]", - states={'done': [('readonly', True)]}) + states={'done': [('readonly', True)]}, help="Lot/Serial Number of the product to unbuild.") has_tracking=fields.Selection(related='product_id.tracking', readonly=True) location_id = fields.Many2one( - 'stock.location', 'Location', + 'stock.location', 'Source Location', default=_get_default_location_id, - required=True, states={'done': [('readonly', True)]}) + required=True, states={'done': [('readonly', True)]}, help="Location where the product you want to unbuild is.") location_dest_id = fields.Many2one( 'stock.location', 'Destination Location', default=_get_default_location_dest_id, - required=True, states={'done': [('readonly', True)]}) + required=True, states={'done': [('readonly', True)]}, help="Location where you want to send the components resulting from the unbuild order.") consume_line_ids = fields.One2many( 'stock.move', 'consume_unbuild_id', readonly=True, string='Consumed Disassembly Lines') From b2ec6bc7ad906b2286005768f19f57e8c6e04dfb Mon Sep 17 00:00:00 2001 From: Darshil Trivedi Date: Mon, 27 Aug 2018 10:10:58 +0000 Subject: [PATCH 2/2] [IMP] mrp: BoM and product as readonly when a MO is set on UB. Since commit 2bd10fa7578a44f0d534020efef059fb054e853d when the user specify a MO the unbuild use the existing moves raw and moves finished in order to create the unbuild moves. In this case the bom_id and the product_id is not needed since we don't generate unbuild move from the BoM This commit is related to task ID 39843. --- addons/mrp/views/mrp_unbuild_views.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/views/mrp_unbuild_views.xml b/addons/mrp/views/mrp_unbuild_views.xml index e811e2a6140..58c1fb6014b 100644 --- a/addons/mrp/views/mrp_unbuild_views.xml +++ b/addons/mrp/views/mrp_unbuild_views.xml @@ -113,13 +113,13 @@ - + + ('type', '=', 'normal')]" attrs="{'readonly':[('mo_id','!=',False)]}" force_save="1"/>