From a1a8d6d44f2d16700d8a92675b9f2e5f4668c2e2 Mon Sep 17 00:00:00 2001 From: Tanguy Charlier Date: Mon, 6 Jun 2016 13:21:38 +0200 Subject: [MIG] barcodes: Simplify selection fields overrides --- addons/stock/models/barcode.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'addons/stock/models/barcode.py') diff --git a/addons/stock/models/barcode.py b/addons/stock/models/barcode.py index 701ce3fc54d..99b88475e47 100644 --- a/addons/stock/models/barcode.py +++ b/addons/stock/models/barcode.py @@ -1,18 +1,15 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import models, _ +from odoo import models, fields, _ class BarcodeRule(models.Model): _inherit = 'barcode.rule' - def _get_type_selection(self): - types = set(super(BarcodeRule, self)._get_type_selection()) - types.update([ + type = fields.Selection(selection_add=[ ('weight', _('Weighted Product')), ('location', _('Location')), ('lot', _('Lot')), ('package', _('Package')) ]) - return list(types) -- cgit v1.2.3