Browse Source

Migration from v9 to v12

pull/491/head
François Kawala 5 years ago
committed by Sylvain LE GAL
parent
commit
6d187130fc
  1. 1
      pos_barcode_tare/__init__.py
  2. 3
      pos_barcode_tare/__manifest__.py
  3. 5
      pos_barcode_tare/demo/pos_barcode_tare_demo.xml
  4. 15
      pos_barcode_tare/models/barcode_rule.py
  5. 4
      pos_barcode_tare/models/pos_config.py
  6. 7
      pos_barcode_tare/static/src/js/pos_barcode_tare.js
  7. 22
      pos_barcode_tare/views/pos_config_view.xml

1
pos_barcode_tare/__init__.py

@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import models from . import models

3
pos_barcode_tare/__openerp__.py → pos_barcode_tare/__manifest__.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# @author: François Kawala # @author: François Kawala
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': "Point of Sale - Tare barecode labels for loose goods", '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', 'category': 'Point of Sale',
'summary': """Point of Sale - Print and scan tare \ 'summary': """Point of Sale - Print and scan tare \
barecodes labels to sell loose goods.""", barecodes labels to sell loose goods.""",

5
pos_barcode_tare/demo/pos_barcode_tare_demo.xml

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="product_uom_kgm_dbg" model="product.uom">
<field name="category_id" ref="product.product_uom_categ_kgm"/>
<record id="product_uom_kgm_dbg" model="uom.uom">
<field name="category_id" ref="uom.product_uom_categ_kgm"/>
<field name="name">Kg</field> <field name="name">Kg</field>
<field name="factor" eval="1"/> <field name="factor" eval="1"/>
<field name="rounding" eval="0.001"/> <field name="rounding" eval="0.001"/>
<field name="uom_type">bigger</field>
</record> </record>
</odoo> </odoo>

15
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): class BarcodeRule(models.Model):
_inherit = 'barcode.rule' _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'))
])

4
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): class PosConfig(models.Model):

7
pos_barcode_tare/static/src/js/pos_barcode_tare.js

@ -1,15 +1,12 @@
odoo.define('pos_barcode_tare.screens', function (require) { odoo.define('pos_barcode_tare.screens', function (require) {
"use strict"; "use strict";
var chrome = require('point_of_sale.chrome');
var core = require('web.core'); var core = require('web.core');
var devices = require('point_of_sale.devices');
var gui = require('point_of_sale.gui'); var gui = require('point_of_sale.gui');
var models = require('point_of_sale.models'); var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens'); var screens = require('point_of_sale.screens');
var utils = require('web.utils'); var utils = require('web.utils');
var formats = require('web.formats');
var field_utils = require('web.field_utils');
var QWeb = core.qweb; var QWeb = core.qweb;
var _t = core._t; var _t = core._t;
var round_pr = utils.round_precision; var round_pr = utils.round_precision;
@ -299,7 +296,7 @@ odoo.define('pos_barcode_tare.screens', function (require) {
if (unit.rounding) { if (unit.rounding) {
var q = round_pr(qty, unit.rounding); var q = round_pr(qty, unit.rounding);
var decimals = self.pos.dp['Product Unit of Measure']; var decimals = self.pos.dp['Product Unit of Measure'];
return formats.format_value(
return field_utils.format.float(
round_di(q, decimals), round_di(q, decimals),
{type: 'float', digits: [69, decimals]}); {type: 'float', digits: [69, decimals]});
} }

22
pos_barcode_tare/views/pos_config_view.xml

@ -1,16 +1,26 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<odoo> <odoo>
<record model="ir.ui.view" id="view_pos_config_form"> <record model="ir.ui.view" id="view_pos_config_form">
<field name="name">view.pos.config.form</field>
<field name="model">pos.config</field> <field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_form" />
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
<field name="priority" eval="30"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="/form/sheet/group[@name='features']" position="inside">
<separator string="Loose good options" colspan="4"/>
<group>
<div id="posbox_reference" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="iface_tare_label"/> <field name="iface_tare_label"/>
</group>
</xpath>
</div>
<div class="o_setting_right_pane">
<label for="iface_tare_label"/>
<div class="text-muted">
Show tare barcode printer button on top of the num pad.
</div>
</div>
</div>
</div>
</field> </field>
</record> </record>
</odoo> </odoo>
Loading…
Cancel
Save