summaryrefslogtreecommitdiff
path: root/addons/stock/models/res_config_settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/stock/models/res_config_settings.py')
-rw-r--r--addons/stock/models/res_config_settings.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/addons/stock/models/res_config_settings.py b/addons/stock/models/res_config_settings.py
index df325822e27..c52262e9515 100644
--- a/addons/stock/models/res_config_settings.py
+++ b/addons/stock/models/res_config_settings.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
+from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
@@ -54,13 +53,6 @@ class ResConfigSettings(models.TransientModel):
def _onchange_group_stock_production_lot(self):
if not self.group_stock_production_lot:
self.group_lot_on_delivery_slip = False
- tracked_products = self.env['product.template'].search([('tracking', 'in', ['lot', 'serial']),])
- if not self.group_stock_production_lot and tracked_products:
- names = ", ".join(tracked_products.mapped('display_name') if len(tracked_products) <= 10
- else tracked_products[:10].mapped('display_name') + ["..."])
- raise UserError(_("You should not remove the 'lots and serial numbers' "
- "option while the following products are still tracked by lot "
- "or serial number:\n %s") % names)
@api.onchange('group_stock_adv_location')
def onchange_adv_location(self):