summaryrefslogtreecommitdiff
path: root/addons/mrp_landed_costs
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2020-02-20 13:43:00 +0000
committerRaphael Collet <rco@odoo.com>2020-03-30 13:42:04 +0000
commit1daf8eb12735db5c697e4a0868b43fe44f6b2f6a (patch)
treeb02820d3679615e7e92a6258a6cc1d428db4c526 /addons/mrp_landed_costs
parentf0481392c6501cae2c38359f526da1eefa451337 (diff)
[FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are extended via `selection_add` are given proper ondelete policies to ensure the cleanup of records containing these extended options during uninstall of the extending module. This commit also cleans up leftover uninstall hooks that were being used to handle the same set of problems prior to the ondelete mechanism being implemented for Selection fields. closes odoo/odoo#46325 Related: odoo/enterprise#9117 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/mrp_landed_costs')
-rw-r--r--addons/mrp_landed_costs/models/stock_landed_cost.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mrp_landed_costs/models/stock_landed_cost.py b/addons/mrp_landed_costs/models/stock_landed_cost.py
index 3e193e39c3c..5d991f8c788 100644
--- a/addons/mrp_landed_costs/models/stock_landed_cost.py
+++ b/addons/mrp_landed_costs/models/stock_landed_cost.py
@@ -7,7 +7,9 @@ from odoo import fields, models, api
class StockLandedCost(models.Model):
_inherit = 'stock.landed.cost'
- target_model = fields.Selection(selection_add=[('manufacturing', "Manufacturing Orders")])
+ target_model = fields.Selection(selection_add=[
+ ('manufacturing', "Manufacturing Orders")
+ ], ondelete={'manufacturing': 'set default'})
mrp_production_ids = fields.Many2many(
'mrp.production', string='Manufacturing order',
copy=False, states={'done': [('readonly', True)]}, groups='mrp.group_mrp_user')