diff --git a/pos_barcode_tare/__init__.py b/pos_barcode_tare/__init__.py index f5ba686b..0650744f 100644 --- a/pos_barcode_tare/__init__.py +++ b/pos_barcode_tare/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- -from . import models \ No newline at end of file +from . import models diff --git a/pos_barcode_tare/__openerp__.py b/pos_barcode_tare/__manifest__.py similarity index 93% rename from pos_barcode_tare/__openerp__.py rename to pos_barcode_tare/__manifest__.py index da267229..f1450117 100644 --- a/pos_barcode_tare/__openerp__.py +++ b/pos_barcode_tare/__manifest__.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # @author: François Kawala # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': "Point of Sale - Tare barecode labels for loose goods", - 'version': '9.0.0.0.1', + 'version': '12.0.1.0.0', 'category': 'Point of Sale', 'summary': """Point of Sale - Print and scan tare \ barecodes labels to sell loose goods.""", diff --git a/pos_barcode_tare/demo/pos_barcode_tare_demo.xml b/pos_barcode_tare/demo/pos_barcode_tare_demo.xml index 7b5767bf..da5fe482 100644 --- a/pos_barcode_tare/demo/pos_barcode_tare_demo.xml +++ b/pos_barcode_tare/demo/pos_barcode_tare_demo.xml @@ -1,9 +1,10 @@ - - + + Kg + bigger diff --git a/pos_barcode_tare/models/barcode_rule.py b/pos_barcode_tare/models/barcode_rule.py index a32c0d71..96f66c0d 100644 --- a/pos_barcode_tare/models/barcode_rule.py +++ b/pos_barcode_tare/models/barcode_rule.py @@ -1,14 +1,9 @@ -# -*- coding: utf-8 -*- - -from openerp import _, models, api - +from odoo import _, models, fields class BarcodeRule(models.Model): _inherit = 'barcode.rule' - @api.model - def _get_type_selection(self): - res = super(BarcodeRule, self)._get_type_selection() - res.append( - ('tare', _('Tare'))) - return res + type = fields.Selection(selection_add=[ + ('tare', _('Tare')) + ]) + diff --git a/pos_barcode_tare/models/pos_config.py b/pos_barcode_tare/models/pos_config.py index c6756101..9cd6cd62 100644 --- a/pos_barcode_tare/models/pos_config.py +++ b/pos_barcode_tare/models/pos_config.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- - -from openerp import models, fields +from odoo import models, fields class PosConfig(models.Model): diff --git a/pos_barcode_tare/static/src/js/pos_barcode_tare.js b/pos_barcode_tare/static/src/js/pos_barcode_tare.js index 927a86cd..15787646 100644 --- a/pos_barcode_tare/static/src/js/pos_barcode_tare.js +++ b/pos_barcode_tare/static/src/js/pos_barcode_tare.js @@ -1,15 +1,12 @@ odoo.define('pos_barcode_tare.screens', function (require) { "use strict"; - var chrome = require('point_of_sale.chrome'); var core = require('web.core'); - var devices = require('point_of_sale.devices'); var gui = require('point_of_sale.gui'); var models = require('point_of_sale.models'); var screens = require('point_of_sale.screens'); var utils = require('web.utils'); - var formats = require('web.formats'); - + var field_utils = require('web.field_utils'); var QWeb = core.qweb; var _t = core._t; var round_pr = utils.round_precision; @@ -299,7 +296,7 @@ odoo.define('pos_barcode_tare.screens', function (require) { if (unit.rounding) { var q = round_pr(qty, unit.rounding); var decimals = self.pos.dp['Product Unit of Measure']; - return formats.format_value( + return field_utils.format.float( round_di(q, decimals), {type: 'float', digits: [69, decimals]}); } diff --git a/pos_barcode_tare/views/pos_config_view.xml b/pos_barcode_tare/views/pos_config_view.xml index ffce7377..3c2415eb 100644 --- a/pos_barcode_tare/views/pos_config_view.xml +++ b/pos_barcode_tare/views/pos_config_view.xml @@ -1,16 +1,26 @@ + + view.pos.config.form pos.config - + + - - - - - - +
+
+
+ +
+
+
+
+