[IMP] stock: allow changing operation type in draft
Rationale: if our users want to do a pick-pack-ship manually, they were unable to duplicate pickings by just changing the operation type. Task: 3290154 Related task: 3010731 Part-of: odoo/odoo#122511
This commit is contained in:
@@ -506,8 +506,9 @@ class Picking(models.Model):
|
||||
for picking in self:
|
||||
picking.has_deadline_issue = picking.date_deadline and picking.date_deadline < picking.scheduled_date or False
|
||||
|
||||
@api.depends('state')
|
||||
def _compute_hide_picking_type(self):
|
||||
self.hide_picking_type = self.env.context.get('default_picking_type_id', False)
|
||||
self.hide_picking_type = self.state != "draft" and self.ids and 'default_picking_type_id' in self.env.context
|
||||
|
||||
@api.depends('move_ids.delay_alert_date')
|
||||
def _compute_delay_alert_date(self):
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<field name="partner_id" nolabel="1" readonly="state in ['cancel', 'done']"/>
|
||||
<field name="picking_type_id" options="{'no_open': True}"
|
||||
invisible="hide_picking_type"
|
||||
readonly="id"
|
||||
readonly="state != 'draft' and id"
|
||||
domain="context.get('restricted_picking_type_code') and [('code', '=', context.get('restricted_picking_type_code'))] or [(1,'=',1)]"/>
|
||||
<field name="location_id" groups="!stock.group_stock_multi_locations" invisible="1" readonly="state == 'done'"/>
|
||||
<field name="location_dest_id" groups="!stock.group_stock_multi_locations" invisible="1" readonly="state == 'done'"/>
|
||||
|
||||
Reference in New Issue
Block a user