diff --git a/.gitignore b/.gitignore index dd6e17c..9318f23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ backup.env checkup.json +addons/ +addons_old/ diff --git a/docker-compose.yml b/docker-compose.yml index 06ea3d2..a5e0e1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,43 +1,22 @@ version: '2' services: web: - image: docker.io/tobru/odoo-pos:latest-pos - build: ./odoo + #image: docker.io/tobru/odoo-pos:latest-pos + image: docker.io/library/odoo:15 + #build: ./odoo depends_on: - db ports: - 80:8069 volumes: - odoo-web-data:/var/lib/odoo + - ./odoo/addons:/mnt/extra-addons environment: - HOST=db - USER=odoo - PASSWORD=odoo - hostname: web - networks: - localnet: - ipv4_address: 10.5.0.2 - iotbox: - image: docker.io/tobru/odoo-pos:latest-iotbox - build: ./iotbox - depends_on: - - db - command: -- --load=web,hw_proxy,hw_posbox_homepage,hw_posbox_upgrade,hw_scale,hw_scanner,hw_escpos,hw_blackbox_be,hw_screen,hw_drivers,hw_printer_network - ports: - - 8070:8069 - - 8072:8072 - volumes: - - /dev/bus/usb:/dev/bus/usb - environment: - - HOST=db - - USER=odoo - - PASSWORD=odoo - hostname: iotbox - networks: - localnet: - ipv4_address: 10.5.0.3 db: - image: postgres:10 + image: postgres:14 environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD=odoo @@ -45,16 +24,6 @@ services: - PGDATA=/var/lib/postgresql/data/pgdata volumes: - odoo-db-data:/var/lib/postgresql/data/pgdata - networks: - localnet: - ipv4_address: 10.5.0.4 volumes: odoo-web-data: odoo-db-data: -networks: - localnet: - driver: bridge - ipam: - config: - - subnet: 10.5.0.0/16 - gateway: 10.5.0.1 diff --git a/iotbox/Dockerfile b/iotbox/Dockerfile index 22e2a07..221c68a 100644 --- a/iotbox/Dockerfile +++ b/iotbox/Dockerfile @@ -85,11 +85,11 @@ RUN patch -p0 /usr/local/lib/python3.5/dist-packages/v4l2.py < /tmp/python-v4l2 # Strings must be UTF-8 for correct printing && patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_escpos/escpos/printer.py < /tmp/utf8-to-printer.patch \ # Disable log messages about disconnected drivers - unneeded and clutters logfile with useless messages - && patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_escpos/controllers/main.py < /tmp/disable-disconnected-logging.patch \ + && patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_escpos/controllers/main.py < /tmp/disable-disconnected-logging.patch # Add cashbox networking support - && patch -p0 /opt/posbox/addons/hw_printer_network/controllers/hw_printer_network_controller.py < /tmp/cashbox-net.patch \ + #&& patch -p0 /opt/posbox/addons/hw_printer_network/controllers/hw_printer_network_controller.py < /tmp/cashbox-net.patch \ # Remove fix from https://github.com/odoo/odoo/pull/35368 as this breaks network printing - && patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_escpos/escpos/escpos.py < /tmp/remove_get_printer_status.patch + #&& patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_escpos/escpos/escpos.py < /tmp/remove_get_printer_status.patch ## Cannot switch to Odoo as CUPS must run as root and CUPS must run - otherwise IoTBox complains #USER odoo diff --git a/odoo/Dockerfile b/odoo/Dockerfile index 31afc8d..902c76c 100644 --- a/odoo/Dockerfile +++ b/odoo/Dockerfile @@ -1,21 +1,21 @@ -FROM odoo:12 +FROM odoo:15 USER root ## Get pos-addons for pos_printer_network -RUN set -x; apt-get update \ - && apt-get -y install --no-install-recommends git \ - && rm -rf /var/lib/apt/lists/* \ - && git clone --depth=1 -b 12.0 https://github.com/it-projects-llc/pos-addons.git \ - /opt/posbox/pos-addons \ - && git clone --depth=1 -b 12.0 https://github.com/camptocamp/odoo-cloud-platform.git \ - /opt/posbox/cloud-addons \ - && git clone --depth=1 -b 12.0 https://github.com/CybroOdoo/CybroAddons.git \ - /opt/posbox/cybro-addons +#RUN set -x; apt-get update \ +# && apt-get -y install --no-install-recommends git \ +# && rm -rf /var/lib/apt/lists/* \ +# && git clone --depth=1 -b 13.0 https://github.com/it-projects-llc/pos-addons.git \ +# /opt/posbox/pos-addons \ +# && git clone --depth=1 -b 13.0 https://github.com/camptocamp/odoo-cloud-platform.git \ +# /opt/posbox/cloud-addons \ +# && git clone --depth=1 -b 13.0 https://github.com/CybroOdoo/CybroAddons.git \ +# /opt/posbox/cybro-addons COPY odoo.conf /etc/odoo/odoo.conf -COPY addons/ /opt/posbox/extra-addons +#COPY addons/ /opt/posbox/extra-addons -RUN chown -R odoo.odoo /opt/posbox +#RUN chown -R odoo.odoo /opt/posbox USER odoo diff --git a/odoo/addons/ip_pos_ticket_order_number/__init__.py b/odoo/addons/ip_pos_ticket_order_number/__init__.py deleted file mode 100644 index 40a96af..0000000 --- a/odoo/addons/ip_pos_ticket_order_number/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/odoo/addons/ip_pos_ticket_order_number/__manifest__.py b/odoo/addons/ip_pos_ticket_order_number/__manifest__.py deleted file mode 100644 index a0e4bfb..0000000 --- a/odoo/addons/ip_pos_ticket_order_number/__manifest__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': 'POS Tickets Order Number', - 'summary': "POS Tickets Order Number", - 'description': """POS Tickets Order Number""", - - 'author': 'iPredict IT Solutions Pvt. Ltd.', - 'website': 'http://ipredictitsolutions.com', - "support": "ipredictitsolutions@gmail.com", - - 'category': 'Point of Sale', - 'version': '12.0.0.1.0', - 'depends': ['pos_restaurant'], - - 'data': [ - 'views/assets.xml', - ], - 'qweb': [ - 'static/src/xml/pos.xml', - ], - - 'license': "OPL-1", - - 'installable': True, - 'application': True, -} diff --git a/odoo/addons/ip_pos_ticket_order_number/static/description/icon.png b/odoo/addons/ip_pos_ticket_order_number/static/description/icon.png deleted file mode 100644 index 77ec129..0000000 Binary files a/odoo/addons/ip_pos_ticket_order_number/static/description/icon.png and /dev/null differ diff --git a/odoo/addons/ip_pos_ticket_order_number/static/src/js/pos_ticket_order_number.js b/odoo/addons/ip_pos_ticket_order_number/static/src/js/pos_ticket_order_number.js deleted file mode 100644 index 38c47db..0000000 --- a/odoo/addons/ip_pos_ticket_order_number/static/src/js/pos_ticket_order_number.js +++ /dev/null @@ -1,59 +0,0 @@ -odoo.define('ip_pos_ticket_order_number.pos_ticket_order_number', function (require) { - "use strict"; - - var Screens = require('point_of_sale.screens'); - var MultiPrint = require('pos_restaurant.multiprint'); - var Models = require('point_of_sale.models'); - var PopUpWidget=require('point_of_sale.popups'); - var Gui = require('point_of_sale.gui'); - var core = require('web.core'); - var QWeb = core.qweb; - var _t = core._t; - - Screens.ReceiptScreenWidget.include({ - get_receipt_render_env: function() { - var receipt = this._super(); - var number = receipt.order.name.split(' ')[1].split('-').pop() - receipt['order_number'] = Number(number).toString(); - receipt['big_number'] = receipt.order.big_number; - return receipt; - } - }); - - var _super_order = Models.Order.prototype; - Models.Order = Models.Order.extend({ - initialize: function() { - _super_order.initialize.apply(this,arguments); - if (typeof this.big_number === 'undefined') { - this.big_number = false; - } - }, - printChanges: function(){ - var printers = this.pos.printers; - for(var i = 0; i < printers.length; i++){ - var changes = this.computeChanges(printers[i].config.product_categories_ids); - if ( changes['new'].length > 0 || changes['cancelled'].length > 0){ - var number = changes.name.split(' ')[1].split('-').pop() - changes['order_number'] = Number(number).toString() - var order = this.pos.get_order() - if (order) {order.set_big_number(true);} - var receipt = QWeb.render('OrderChangeReceipt',{changes:changes, widget:this}); - printers[i].print(receipt); - } - } - }, - set_big_number: function(val){ - this.big_number = val; - this.trigger('change',this); - }, - init_from_JSON: function(json) { - _super_order.init_from_JSON.apply(this,arguments); - this.big_number = json.big_number; - }, - export_as_JSON: function() { - var json = _super_order.export_as_JSON.apply(this,arguments); - json.big_number = this.big_number; - return json; - }, - }); -}); diff --git a/odoo/addons/ip_pos_ticket_order_number/static/src/xml/pos.xml b/odoo/addons/ip_pos_ticket_order_number/static/src/xml/pos.xml deleted file mode 100644 index 5ba7d00..0000000 --- a/odoo/addons/ip_pos_ticket_order_number/static/src/xml/pos.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - -
- Bestellnummer: -
-

-
-
- - - - -
- -
-
-
- - - -
- -
-
-
- -
diff --git a/odoo/addons/ip_pos_ticket_order_number/views/assets.xml b/odoo/addons/ip_pos_ticket_order_number/views/assets.xml deleted file mode 100644 index d4bd9f7..0000000 --- a/odoo/addons/ip_pos_ticket_order_number/views/assets.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/odoo/addons/pos_product_sequence/__init__.py b/odoo/addons/pos_product_sequence/__init__.py index cde864b..1d96e63 100644 --- a/odoo/addons/pos_product_sequence/__init__.py +++ b/odoo/addons/pos_product_sequence/__init__.py @@ -1,3 +1,5 @@ # -*- coding: utf-8 -*- +# Powered by Kanak Infosystems LLP. +# © 2020 Kanak Infosystems LLP. () from . import models diff --git a/odoo/addons/pos_product_sequence/__manifest__.py b/odoo/addons/pos_product_sequence/__manifest__.py index a13d1f6..0a83897 100644 --- a/odoo/addons/pos_product_sequence/__manifest__.py +++ b/odoo/addons/pos_product_sequence/__manifest__.py @@ -1,22 +1,33 @@ # -*- coding: utf-8 -*- +# Powered by Kanak Infosystems LLP. +# © 2020 Kanak Infosystems LLP. () + { 'name': 'POS Product Sequence', - 'version': '1.0', - 'summary': 'Point of Sale Product Sequence', + 'version': '15.0.1.0', + 'summary': 'POS Product Sequence module is used in Odoo POS to display the products position in POS Session according to the sequence or numbers assigned. If you have 5 products in backend and you want to set its sequence from 1 to 5, then same sequence wise product show in POS Session in odoo.', 'description': """ Point of Sale Product Sequence """, 'license': 'OPL-1', - 'author': 'Kanak Infosystems LLP', + 'author': 'Kanak Infosystems LLP.', 'website': 'https://www.kanakinfosystems.com', - 'images': ['static/description/main_image.jpeg'], - 'category': 'Point of Sale', + 'images': ['static/description/banner.jpeg'], + 'category': 'Sales/Point of Sale', 'depends': ['point_of_sale'], 'data': [ - 'views/template.xml', - 'views/pos_product_sequence_views.xml', + 'views/knk_pos_product_sequence_views.xml', ], - 'application': True, + 'assets': { + 'point_of_sale.assets': [ + 'pos_product_sequence/static/src/js/models.js', + ], + }, + 'sequence': 1, + 'installable': True, + 'application': False, + 'auto_install': False, 'price': 10, 'currency': 'EUR', + 'live_test_url': 'https://youtu.be/pYVNy3A3ieE', } diff --git a/odoo/addons/pos_product_sequence/models/__init__.py b/odoo/addons/pos_product_sequence/models/__init__.py index d7d7308..702dcfb 100644 --- a/odoo/addons/pos_product_sequence/models/__init__.py +++ b/odoo/addons/pos_product_sequence/models/__init__.py @@ -1,3 +1,5 @@ # -*- coding: utf-8 -*- +# Powered by Kanak Infosystems LLP. +# © 2020 Kanak Infosystems LLP. () -from . import product +from . import knk_product diff --git a/odoo/addons/pos_product_sequence/models/__init__.pyc b/odoo/addons/pos_product_sequence/models/__init__.pyc deleted file mode 100644 index 6a01310..0000000 Binary files a/odoo/addons/pos_product_sequence/models/__init__.pyc and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/models/product.py b/odoo/addons/pos_product_sequence/models/product.py deleted file mode 100644 index f67570f..0000000 --- a/odoo/addons/pos_product_sequence/models/product.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import fields, models, api - - -class ProductProduct(models.Model): - _inherit = "product.product" - _order = 'pos_sequence, default_code, name, id' - -class ProductTemplate(models.Model): - _inherit = "product.template" - _order = 'pos_sequence, name' - - pos_sequence = fields.Integer(string='POS Sequence', help='POS product display base on product sequence number') - - @api.model - def create(self, vals): - res = super(ProductTemplate, self).create(vals) - if res: - rec = self.search([]) - if rec: - seq = max(self.search([]).mapped('pos_sequence')) - if seq: - res.pos_sequence = seq + 1; - return res \ No newline at end of file diff --git a/odoo/addons/pos_product_sequence/models/product.pyc b/odoo/addons/pos_product_sequence/models/product.pyc deleted file mode 100644 index acc4472..0000000 Binary files a/odoo/addons/pos_product_sequence/models/product.pyc and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/aftercdsequence.png b/odoo/addons/pos_product_sequence/static/description/aftercdsequence.png deleted file mode 100644 index 142d094..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/aftercdsequence.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/beforeposview.png b/odoo/addons/pos_product_sequence/static/description/beforeposview.png deleted file mode 100644 index c68c2a7..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/beforeposview.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/beforeproduct.png b/odoo/addons/pos_product_sequence/static/description/beforeproduct.png deleted file mode 100644 index 5c49c51..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/beforeproduct.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/call-icon.png b/odoo/addons/pos_product_sequence/static/description/call-icon.png deleted file mode 100644 index 14f116d..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/call-icon.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/cdafterposview.png b/odoo/addons/pos_product_sequence/static/description/cdafterposview.png deleted file mode 100644 index eb1d798..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/cdafterposview.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/features-icon.png b/odoo/addons/pos_product_sequence/static/description/features-icon.png deleted file mode 100644 index 8d6b2f7..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/features-icon.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon-2.png b/odoo/addons/pos_product_sequence/static/description/icon-2.png deleted file mode 100644 index 447419b..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon-2.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon-3.png b/odoo/addons/pos_product_sequence/static/description/icon-3.png deleted file mode 100644 index 87af289..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon-3.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon-4.png b/odoo/addons/pos_product_sequence/static/description/icon-4.png deleted file mode 100644 index a3340a7..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon-4.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon-5.png b/odoo/addons/pos_product_sequence/static/description/icon-5.png deleted file mode 100644 index 65d77bd..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon-5.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon-6.png b/odoo/addons/pos_product_sequence/static/description/icon-6.png deleted file mode 100644 index 7a1044f..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon-6.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/icon1.png b/odoo/addons/pos_product_sequence/static/description/icon1.png deleted file mode 100644 index 00b2c78..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/icon1.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/index.html b/odoo/addons/pos_product_sequence/static/description/index.html index 1fe707e..3657b6f 100644 --- a/odoo/addons/pos_product_sequence/static/description/index.html +++ b/odoo/addons/pos_product_sequence/static/description/index.html @@ -1,136 +1,495 @@ -
-
-
-

Product sorting on POS interface base on POS sequence

-
-
-
-
-
-
-

Before POS Product Sequence

-
-
-
- +
+
+
+
+

+ POS Product Sequence +

-
-
-
-
-
-

Before POS Product Views

+
+
+ +
-
-
- +
+
+
+
Supported Editions
+
+
Community
+
Enterprise
- -
-
-
-
-

After Product POS Sequence

-
-
-
- +
+
+

POS Product Sequence module is used in Odoo POS to display the product's position in POS Session according to the sequence of numbers assigned. If you have 5 products in the backend and you want to set its sequence from 1 to 5, then the same sequence wise product show in POS Session in odoo. +

-
-
-
-
-
-

After POS Product View. First Display of This Product

+
+
+
+

Key Features

-
-
- +
+
+

+ User can set the Product sequence number. +

+
+
+

+ It shows sequence wise products in Odoo POS. +

+
+
+

+ User can manage the POS Sequence of Product in the Backend. +

-
-
-
-
-
-
-
- +
+
+
+ +
+
+
+
+
+
+
+ Before POS Product Sequence +

+
+
+
+
+
+
+ +
+
+
+
+ Set Product Sequence +

+
    +
  • + Navigate to the Point of Sale and click on the Products menu. +
  • +
  • + Open Products Variants sub-menu and click on Point of Sale tab. +
  • +
  • + Now, we will set POS Sequence number. +
  • +
+
+
+
+
+ +
+
+
+
+ After POS Product Sequence +

+
    +
  • + Now, we will open Odoo POS and check the position of configured product. +
  • +
  • + Here, we can see configured product is in 2nd position. +
  • +
+
+
+
+
+ +
+
+
+

+
+
+
+
+ +
+
+ 4th + January, 2021 +
+
+
+

Latest Release 1.0

+

+ First version to release. +

+
+
+
+
+
+
+
+
+

+

Here See Demo Video:-

+ +
+

+
+
+
+

Frequently Asked Question:-

+
+
+
+
+
+
Is this app compatible with Odoo Enterprise? +
+ +
+
+
+
+ Yes, our app works with Odoo Enterprise as well as Community. +
+
+
+
+
+
+
+
+
+
+
Is this app compatible with Windows or Ubuntu? +
+ +
+
+
+
+ Yes, our app works with Windows or Ubuntu operating system. +
+
+
+
+
+
+
+
+
+
+
Is this app required any additional configuration? +
+ +
+
+
+
+ No, install module and use this features. +
+
+
+
+
+
+
+
-
+
+
+

FREE 3 MONTHS SUPPORT

+
+
+
+

Kanak Infosystem will provide free 3 months support for bug fixes, any doubts or queries, installation, configuration support or any types of issues related to this module.

+

+ NOTE: This module do not required extra configuration. +
+
+
+
+
+ + sales@kanakinfosystems.com
+
+ + kanakinfosystems
-
-
"We are groupies wrapped in Creativity, Skills and Innovation"
-

We are authorized IT company to offer advanced, hight quality and affordable IT solutions. We have years of rich experience in the field of ODOO Development, ERP Solutions, Web Development, Mobile Apps, Web Designing and Digital marketing. Around a decade are offering quality assured and 100% customer satisfaction services to global clientele.

- -

Our highly experienced and devoted team of professionals works with there heart, passion and talent to provide the most dedicated IT Business Solutions to our valuable clients globally. Our team works on the real words "Dedication,"Timely Deliverables",And "Happy Clients"!

+
+ + +91 9818108884
-
-
-

What We Do

+
+
+
+
+ + + + + + +
+
+ SUGGESTED APPS + + App Link
-
-
- -
Odoo Customization
-
-
- -
Odoo Code Migration
-
-
- -
Odoo Mobile App
-
-
- -
Odoo DB Migration
-
-
- -
Odoo Web Development
-
-
- -
Odoo Themes
+
+
+
+
+
+
+
+ SUGGESTED APPS + + App Link +
-
\ No newline at end of file + + +
+ +
+ \ No newline at end of file diff --git a/odoo/addons/pos_product_sequence/static/description/main_image.jpeg b/odoo/addons/pos_product_sequence/static/description/main_image.jpeg deleted file mode 100644 index a53792b..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/main_image.jpeg and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/description/support-icon.png b/odoo/addons/pos_product_sequence/static/description/support-icon.png deleted file mode 100644 index c169f79..0000000 Binary files a/odoo/addons/pos_product_sequence/static/description/support-icon.png and /dev/null differ diff --git a/odoo/addons/pos_product_sequence/static/src/js/models.js b/odoo/addons/pos_product_sequence/static/src/js/models.js index 7d6ed27..f01493e 100644 --- a/odoo/addons/pos_product_sequence/static/src/js/models.js +++ b/odoo/addons/pos_product_sequence/static/src/js/models.js @@ -1,54 +1,70 @@ -odoo.define('pos_product_sequence.models', function (require) { -"use strict"; +odoo.define('pos_product_sequence.models', function(require) { + "use strict"; -var models = require('point_of_sale.models'); -var core = require('web.core'); + var models = require('point_of_sale.models'); + var core = require('web.core'); -var QWeb = core.qweb; -var _t = core._t; -var PosDB = require('point_of_sale.DB') -var exports = require('point_of_sale.models'); + var QWeb = core.qweb; + var _t = core._t; + var PosDB = require('point_of_sale.DB'); + const Registries = require('point_of_sale.Registries'); + const ProductsWidget = require('point_of_sale.ProductsWidget'); -PosDB.include({ - get_product_by_category: function(category_id){ - var product_ids = this.product_by_category_id[category_id]; - var list = []; - if (product_ids) { - for (var i = 0, len = Math.min(product_ids.length, this.limit); i < len; i++) { - list.push(this.product_by_id[product_ids[i]]); - } - } - if(list.length){ - var new_list = _.sortBy(list, function(num) { - return num.pos_sequence; - }); - return new_list; - } - return list; - }, -}); - -models.load_models({ - model: 'product.product', - // todo remove list_price in master, it is unused - fields: ['display_name', 'list_price', 'lst_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id', - 'barcode', 'default_code', 'to_weight', 'uom_id', 'description_sale', 'description', - 'product_tmpl_id','tracking','pos_sequence'], - order: _.map(['pos_sequence','sequence','default_code','name'], function (name) { return {name: name}; }), - domain: [['sale_ok','=',true],['available_in_pos','=',true]], - context: function(self){ return { display_default_code: false }; }, - loaded: function(self, products){ - var using_company_currency = self.config.currency_id[0] === self.company.currency_id[0]; - var conversion_rate = self.currency.rate / self.company_currency.rate; - self.db.add_products(_.map(products, function (product) { - if (!using_company_currency) { - product.lst_price = round_pr(product.lst_price * conversion_rate, self.currency.rounding); + PosDB.include({ + get_product_by_category: function(category_id) { + var product_ids = this.product_by_category_id[category_id]; + var list = []; + if (product_ids) { + for (var i = 0, len = Math.min(product_ids.length, this.limit); i < len; i++) { + list.push(this.product_by_id[product_ids[i]]); } - product.categ = _.findWhere(self.product_categories, {'id': product.categ_id[0]}); - return new exports.Product({}, product); - })); + } + if (list.length) { + var new_list = _.sortBy(list, function(num) { + return num.pos_sequence; + }); + return new_list; + } + return list; }, }); -return exports; + models.PosModel.prototype.models.some(function(model) { + if (model.model !== 'product.product') { + return false; + } + // add name and attribute_value_ids to list of fields + // to fetch for product.product + ['pos_sequence'].forEach(function(field) { + if (model.fields.indexOf(field) == -1) { + model.fields.push(field); + } + }); + model['order'] = _.map(['pos_sequence', 'sequence', 'default_code', 'name'], function(name) { return { name: name }; }); + return true; //exit early the iteration of this.models + }); + + const BiProductsTemplateWidget = (ProductsWidget) => + class extends ProductsWidget { + constructor() { + super(...arguments); + } + + get productsToDisplay() { + let list = []; + if (this.searchWord !== '') { + list = this.env.pos.db.search_product_in_category( + this.selectedCategoryId, + this.searchWord + ); + } else { + list = this.env.pos.db.get_product_by_category(this.selectedCategoryId); + } + return list + } + }; + + Registries.Component.extend(ProductsWidget, BiProductsTemplateWidget); + + return ProductsWidget; }); \ No newline at end of file diff --git a/odoo/addons/pos_product_sequence/views/pos_product_sequence_views.xml b/odoo/addons/pos_product_sequence/views/pos_product_sequence_views.xml deleted file mode 100644 index 7b714bc..0000000 --- a/odoo/addons/pos_product_sequence/views/pos_product_sequence_views.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - product.product.tree.inherit - product.product - - - - - - - - - - product.template.tree.inherit - product.template - - - - 1 - - - - - - - - - product.template.form.inherit - product.template - - - - - - - - - - diff --git a/odoo/addons/pos_product_sequence/views/template.xml b/odoo/addons/pos_product_sequence/views/template.xml deleted file mode 100644 index 0ee8eac..0000000 --- a/odoo/addons/pos_product_sequence/views/template.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/odoo/odoo.conf b/odoo/odoo.conf index 081482d..dacb399 100644 --- a/odoo/odoo.conf +++ b/odoo/odoo.conf @@ -1,4 +1,3 @@ [options] -addons_path = /opt/posbox/pos-addons,/opt/posbox/extra-addons,/opt/posbox/cloud-addons,/opt/posbox/cybro-addons data_dir = /var/lib/odoo admin_passwd = S3Cur3Passw0rd