summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorKinjal Mehta <kme@odoo.com>2018-03-22 20:18:24 +0530
committerSimon Lejeune <sle@openerp.com>2018-04-16 16:00:46 +0200
commit026be48ccbbb15daefda070697b135f089f49564 (patch)
tree565b1b0042917be1b172d1c09236e3381dd7172e /addons
parentcc583a4ab22903a5058dc8d0c7c0e428ad7caa62 (diff)
[FIX] purchase: "product_type" related field on po line
Issue: Currently, since "product_type" is not set readonly, it is triggering write() of product.product model when saving a PO having PO line with product_id. And it is failing by throwing access error for users belonging to purchase "User" group users due to the fact that write() is permissible to purchase "Manager" group users only. Solution: Made the "product_type" related field readonly since it is used in purchase order views domain with lone purpose to set "received_qty" field non-editable when order line product is of type stockable/consumable. task id 1818787
Diffstat (limited to 'addons')
-rw-r--r--addons/purchase/models/purchase.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py
index 94b00480bf1..f068dbf9af1 100644
--- a/addons/purchase/models/purchase.py
+++ b/addons/purchase/models/purchase.py
@@ -647,7 +647,7 @@ class PurchaseOrderLine(models.Model):
product_image = fields.Binary(
'Product Image', related="product_id.image",
help="Non-stored related field to allow portal user to see the image of the product he has ordered")
- product_type = fields.Selection(related='product_id.type')
+ product_type = fields.Selection(related='product_id.type', readonly=True)
move_ids = fields.One2many('stock.move', 'purchase_line_id', string='Reservation', readonly=True, ondelete='set null', copy=False)
price_unit = fields.Float(string='Unit Price', required=True, digits=dp.get_precision('Product Price'))