[FIX] delivery, stock: carrier_id field in incoming stock picking
The field "carrier_id" must be hidden for the incoming stock picking.
In stock picking view form,
for an incoming stock picking, the Destination Location Zone must be hidden
for an outgoing stock picking, the Source Location Zone must be hidden
Introduced by 2cb3a90
opw:676411
This commit is contained in:
@@ -276,7 +276,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//group[@name="carrier_data"]' position='replace'>
|
||||
<group name='carrier_data'>
|
||||
<field name="carrier_id"/>
|
||||
<field name="carrier_id" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>
|
||||
<field name="delivery_type" attrs="{'invisible':True}"/>
|
||||
<label for="carrier_tracking_ref"/>
|
||||
<div>
|
||||
|
||||
@@ -929,6 +929,15 @@ class stock_picking(models.Model):
|
||||
picking_type = self.env['stock.picking.type'].browse(picking_type_id)
|
||||
return picking_type.default_location_src_id
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
res = super(stock_picking, self).default_get(fields)
|
||||
if self._context.get('default_picking_type_id') and 'picking_type_id' in fields:
|
||||
picking_type = self.env['stock.picking.type'].browse(res['picking_type_id'])
|
||||
res['picking_type_code'] = picking_type.code
|
||||
return res
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Reference', select=True, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, copy=False),
|
||||
'origin': fields.char('Source Document', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, help="Reference of the document", select=True),
|
||||
|
||||
@@ -862,8 +862,8 @@
|
||||
<group class="hidden-xs">
|
||||
<group>
|
||||
<field name="partner_id" attrs="{'invisible': [('picking_type_code', '=', 'internal')]}" on_change="onchange_picking_type(picking_type_id,partner_id)"/>
|
||||
<field name="location_id" groups="stock.group_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>
|
||||
<field name="location_dest_id" groups="stock.group_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}"/>
|
||||
<field name="location_id" groups="stock.group_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}"/>
|
||||
<field name="location_dest_id" groups="stock.group_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>
|
||||
<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user