From 6392dafc372cf2bf711b5d8b603e8a514f10af23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 26 Jun 2013 16:46:30 +0200 Subject: [PATCH] Add missing ondelete CASCADE for product, warehouse and location review922002 --- location.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/location.py b/location.py index 639776230c..af479c5cb8 100644 --- a/location.py +++ b/location.py @@ -17,11 +17,12 @@ class ProductLocation(ModelSQL, ModelView): ''' __name__ = 'stock.product.location' product = fields.Many2One('product.product', 'Product', required=True, - select=True) + select=True, ondelete='CASCADE') warehouse = fields.Many2One('stock.location', 'Warehouse', required=True, - domain=[('type', '=', 'warehouse')]) + domain=[('type', '=', 'warehouse')], ondelete='CASCADE') location = fields.Many2One('stock.location', 'Storage Location', - required=True, domain=[ + required=True, ondelete='CASCADE', + domain=[ ('type', '=', 'storage'), ('parent', 'child_of', If(Bool(Eval('warehouse')), [Eval('warehouse')], [])),