[IMP] mrp: only show reserved when no show operations on picking type

Because the stock.move.line view (when Show Operations is checked on the
picking type) does not take into account the show reserved setting on
the picking type, it is better not to show the checkbox when show
operations is checked. We add an onchange to always check the "show
reserved" settings when "show operaions" is checked.
This commit is contained in:
Josse Colpaert
2017-09-30 10:38:17 +02:00
committed by Simon Lejeune
parent 2cf234df6d
commit ef86e6a816
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -134,6 +134,11 @@ class PickingType(models.Model):
self.default_location_src_id = self.env.ref('stock.stock_location_stock').id
self.default_location_dest_id = self.env.ref('stock.stock_location_customers').id
@api.onchange('show_operations')
def onchange_show_operations(self):
if self.show_operations is True:
self.show_reserved = True
def _get_action(self, action_xmlid):
# TDE TODO check to have one view + custo in methods
action = self.env.ref(action_xmlid).read()[0]
+1 -1
View File
@@ -47,7 +47,7 @@
<field attrs='{"invisible": [("code", "not in", ["incoming", "outgoing", "internal"])]}' name="return_picking_type_id"/>
<field attrs='{"invisible": [("code", "not in", ["incoming", "outgoing", "internal"])]}' name="barcode_nomenclature_id" groups="base.group_no_one"/>
<field name="show_operations"/>
<field name="show_reserved"/>
<field name="show_reserved" attrs="{'invisible': [('show_operations', '!=', False)]}"/>
</group>
</group>
<group>