diff --git a/pos_price_to_weight/data/barcode_rule.xml b/pos_price_to_weight/data/barcode_rule.xml index 21fbc514..72cab823 100644 --- a/pos_price_to_weight/data/barcode_rule.xml +++ b/pos_price_to_weight/data/barcode_rule.xml @@ -9,7 +9,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). Price Barcodes (Computed Weight) 2 Decimals - + price_to_weight 02.....{NNNDD} 15 diff --git a/pos_price_to_weight/models/barcode_rule.py b/pos_price_to_weight/models/barcode_rule.py index d268390b..be66165b 100644 --- a/pos_price_to_weight/models/barcode_rule.py +++ b/pos_price_to_weight/models/barcode_rule.py @@ -3,15 +3,12 @@ # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import _, api, models +from odoo import _, fields, models class BarcodeRule(models.Model): _inherit = 'barcode.rule' - @api.model - def _get_type_selection(self): - res = super(BarcodeRule, self)._get_type_selection() - res.append( - ('price_to_weight', _('Priced Product (Computed Weight)'))) - return res + type = fields.Selection(selection_add=[ + ('price_to_weight', _('Priced Product (Computed Weight)')) + ])