From 0b9fbc67bbbb91d10b3ed7aaf6f7327628e59c36 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 7 Jan 2016 10:24:54 +0100 Subject: [PATCH] [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 --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 8e9adb74f32..247a932329a 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -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