[FIX] purchase: prevent write on the related stock.location
`default_location_dest_id_usage` on `purchase.order` is used only for an attrs domain on the field `dest_address_id` in the purchase order form. There is therefore no worries to set it as readonly, it won't break the feature he has been added for. Besides, this will prevent the useless write of the same field value on the related `stock.location` when saving the purchase order. This is important to prevent the useless write on `stock.location`, as users might have the rights to create/edit purchase orders without having the write access to the stock locations. opw-660736
This commit is contained in:
@@ -150,7 +150,7 @@ class PurchaseOrder(models.Model):
|
||||
picking_type_id = fields.Many2one('stock.picking.type', 'Deliver To', states=READONLY_STATES, required=True, default=_default_picking_type,\
|
||||
help="This will determine picking type of incoming shipment")
|
||||
default_location_dest_id_usage = fields.Selection(related='picking_type_id.default_location_dest_id.usage', string='Destination Location Type',\
|
||||
help="Technical field used to display the Drop Ship Address")
|
||||
help="Technical field used to display the Drop Ship Address", readonly=True)
|
||||
group_id = fields.Many2one('procurement.group', string="Procurement Group")
|
||||
|
||||
@api.model
|
||||
|
||||
Reference in New Issue
Block a user