diff --git a/pos_product_creation/__init__.py b/pos_product_creation/__init__.py new file mode 100644 index 000000000..5d8a4f372 --- /dev/null +++ b/pos_product_creation/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import controllers diff --git a/pos_product_creation/__manifest__.py b/pos_product_creation/__manifest__.py new file mode 100644 index 000000000..6ee7da6f4 --- /dev/null +++ b/pos_product_creation/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': 'Create Products From POS', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Create Products From POS Interface', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + ], + 'assets': { + + 'web.assets_backend': [ + 'pos_product_creation/static/src/js/product_create_popup.js', + 'pos_product_creation/static/src/js/product_create_button.js' + ], + 'web.assets_qweb': + [ + 'pos_product_creation/static/src/xml/product_create_button.xml', + 'pos_product_creation/static/src/xml/product_create_popup.xml', + + ], + + + }, + + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/pos_product_creation/controllers/__init__.py b/pos_product_creation/controllers/__init__.py new file mode 100644 index 000000000..de31fa4a1 --- /dev/null +++ b/pos_product_creation/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import main diff --git a/pos_product_creation/controllers/main.py b/pos_product_creation/controllers/main.py new file mode 100644 index 000000000..f36877e0d --- /dev/null +++ b/pos_product_creation/controllers/main.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Sayooj A O @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +from odoo import http +from odoo.http import request + + +class PosProductCreation(http.Controller): + + @http.route('/create_product', type="json", auth="none") + def create_product(self, category, name, price, product_reference, unit_measure, product_categories, **kwargs): + product_category = '' + if category == 'Consumable': + product_category = 'consu' + elif category == 'Service': + product_category = 'service' + elif category == 'Stockable': + product_category = 'product' + else: + product_category = '' + request.env['product.template'].sudo().create({ + 'name': name, + 'type': product_category, + 'default_code': product_reference, + 'list_price': float(price), + 'uom_id': int(unit_measure), + 'uom_po_id': int(unit_measure), + 'categ_id': int(product_categories), + 'available_in_pos': True, + }) + diff --git a/pos_product_creation/static/description/assets/icons/check.png b/pos_product_creation/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/check.png differ diff --git a/pos_product_creation/static/description/assets/icons/chevron.png b/pos_product_creation/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/chevron.png differ diff --git a/pos_product_creation/static/description/assets/icons/cogs.png b/pos_product_creation/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/cogs.png differ diff --git a/pos_product_creation/static/description/assets/icons/consultation.png b/pos_product_creation/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/consultation.png differ diff --git a/pos_product_creation/static/description/assets/icons/ecom-black.png b/pos_product_creation/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/ecom-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/education-black.png b/pos_product_creation/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/education-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/hotel-black.png b/pos_product_creation/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/hotel-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/license.png b/pos_product_creation/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/license.png differ diff --git a/pos_product_creation/static/description/assets/icons/lifebuoy.png b/pos_product_creation/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_product_creation/static/description/assets/icons/manufacturing-black.png b/pos_product_creation/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/pos-black.png b/pos_product_creation/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/pos-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/puzzle.png b/pos_product_creation/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/puzzle.png differ diff --git a/pos_product_creation/static/description/assets/icons/restaurant-black.png b/pos_product_creation/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/service-black.png b/pos_product_creation/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/service-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/trading-black.png b/pos_product_creation/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/trading-black.png differ diff --git a/pos_product_creation/static/description/assets/icons/training.png b/pos_product_creation/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/training.png differ diff --git a/pos_product_creation/static/description/assets/icons/update.png b/pos_product_creation/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/update.png differ diff --git a/pos_product_creation/static/description/assets/icons/user.png b/pos_product_creation/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/user.png differ diff --git a/pos_product_creation/static/description/assets/icons/wrench.png b/pos_product_creation/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_product_creation/static/description/assets/icons/wrench.png differ diff --git a/pos_product_creation/static/description/assets/modules/1.png b/pos_product_creation/static/description/assets/modules/1.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/1.png differ diff --git a/pos_product_creation/static/description/assets/modules/2.png b/pos_product_creation/static/description/assets/modules/2.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/2.png differ diff --git a/pos_product_creation/static/description/assets/modules/3.png b/pos_product_creation/static/description/assets/modules/3.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/3.png differ diff --git a/pos_product_creation/static/description/assets/modules/4.png b/pos_product_creation/static/description/assets/modules/4.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/4.png differ diff --git a/pos_product_creation/static/description/assets/modules/5.png b/pos_product_creation/static/description/assets/modules/5.png new file mode 100644 index 000000000..cfb5be33c Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/5.png differ diff --git a/pos_product_creation/static/description/assets/modules/6.png b/pos_product_creation/static/description/assets/modules/6.png new file mode 100644 index 000000000..f01b10060 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/6.png differ diff --git a/pos_product_creation/static/description/assets/modules/approval_image.png b/pos_product_creation/static/description/assets/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/approval_image.png differ diff --git a/pos_product_creation/static/description/assets/modules/dynamic_image.png b/pos_product_creation/static/description/assets/modules/dynamic_image.png new file mode 100644 index 000000000..f55c47e0f Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/dynamic_image.png differ diff --git a/pos_product_creation/static/description/assets/modules/list_view_image.png b/pos_product_creation/static/description/assets/modules/list_view_image.png new file mode 100644 index 000000000..510d36ae9 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/list_view_image.png differ diff --git a/pos_product_creation/static/description/assets/modules/multiple_ref_image.png b/pos_product_creation/static/description/assets/modules/multiple_ref_image.png new file mode 100644 index 000000000..3fe90e552 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/multiple_ref_image.png differ diff --git a/pos_product_creation/static/description/assets/modules/print_image.png b/pos_product_creation/static/description/assets/modules/print_image.png new file mode 100644 index 000000000..b470725a1 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/print_image.png differ diff --git a/pos_product_creation/static/description/assets/modules/product_return_image.png b/pos_product_creation/static/description/assets/modules/product_return_image.png new file mode 100644 index 000000000..3afc14722 Binary files /dev/null and b/pos_product_creation/static/description/assets/modules/product_return_image.png differ diff --git a/pos_product_creation/static/description/assets/screenshots/1.png b/pos_product_creation/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6334f78f2 Binary files /dev/null and b/pos_product_creation/static/description/assets/screenshots/1.png differ diff --git a/pos_product_creation/static/description/assets/screenshots/2.png b/pos_product_creation/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5b32edbcd Binary files /dev/null and b/pos_product_creation/static/description/assets/screenshots/2.png differ diff --git a/pos_product_creation/static/description/assets/screenshots/hero.gif b/pos_product_creation/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..c7b38aba1 Binary files /dev/null and b/pos_product_creation/static/description/assets/screenshots/hero.gif differ diff --git a/pos_product_creation/static/description/banner.png b/pos_product_creation/static/description/banner.png new file mode 100644 index 000000000..667c6aba4 Binary files /dev/null and b/pos_product_creation/static/description/banner.png differ diff --git a/pos_product_creation/static/description/icon.png b/pos_product_creation/static/description/icon.png new file mode 100644 index 000000000..e94061bf0 Binary files /dev/null and b/pos_product_creation/static/description/icon.png differ diff --git a/pos_product_creation/static/description/index.html b/pos_product_creation/static/description/index.html new file mode 100644 index 000000000..b005d314a --- /dev/null +++ b/pos_product_creation/static/description/index.html @@ -0,0 +1,536 @@ +
+
+
+

+ Create Products From POS

+

+ Create Products From POS +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ The module provisions the end user to create products directly from Point of Sale. The new + button "Create Product", shall enable the end user to add details such as + product name, internal reference, price, type, category and more from POS. Upon clicking the + confirm button, a new product shall be created based on provided details.

+ +
+
+ +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Allows you to create products from Point of Sale

+
+
+
+ +
+
+

+ Screenshots +

+
+ +
+

+ Enter the details of products.

+

+ Enter the details of products right from the POS.

+ + +
+ +
+

+ Real-time product list update.

+

+ The products list will be updated real time. It is not needed to reload the page to show + the newly created product in Point of Sale products list. +

+ + +
+
+ + +
+
+

Suggested Products

+
+ + +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/pos_product_creation/static/src/img/content.png b/pos_product_creation/static/src/img/content.png new file mode 100644 index 000000000..a2d397083 Binary files /dev/null and b/pos_product_creation/static/src/img/content.png differ diff --git a/pos_product_creation/static/src/js/product_create_button.js b/pos_product_creation/static/src/js/product_create_button.js new file mode 100644 index 000000000..711a4f0d1 --- /dev/null +++ b/pos_product_creation/static/src/js/product_create_button.js @@ -0,0 +1,71 @@ +odoo.define('owl_tutorials.product_create_button', function(require) { + 'use strict'; + const { Gui } = require('point_of_sale.Gui'); + const PosComponent = require('point_of_sale.PosComponent'); + const { posbus } = require('point_of_sale.utils'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const PaymentScreen = require('point_of_sale.PaymentScreen'); + const ajax = require('web.ajax'); + + class ProductCreateButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this.onClick); + } + async onClick() { + var self = this; + const { + confirmed, + payload + } = await this.showPopup('ProductCreatePopup', { + title: this.env._t('POS Product Creation'), + body: this.env._t('You can Create The product.'), + }); + if (confirmed) { + var product_category = payload[0]; + var product_name = payload[1]; + var product_reference = payload[2]; + var product_price = payload[3]; + var unit_measure = payload[4]; + var product_categories = payload[5]; + console.log(product_category, 'product_category') + console.log(product_name, 'product_name') + console.log(product_reference, 'product_reference') + console.log(product_price, 'product_price') + console.log(unit_measure, 'unit_measure') + if (!product_name){ + return this.showPopup('ErrorPopup', { + title: _('A Unit Of Measure Is Required'), + }); + } + if (!unit_measure){ + return this.showPopup('ErrorPopup', { + title: _('A Unit Of Measure Is Required'), + }); + } + ajax.jsonRpc('/create_product', 'call', { + 'category': product_category, + 'name': product_name, + 'price': product_price, + 'product_reference': product_reference, + 'unit_measure': unit_measure, + 'product_categories': product_categories, + }).then(function(response) {}); + } + } + } + ProductCreateButton.template = 'ProductCreateButton'; + ProductScreen.addControlButton({ + component: ProductCreateButton, + condition: function() { + return true; + }, + position: ['before', 'SetPricelistButton'], + }); + + Registries.Component.add(ProductCreateButton); + + return ProductCreateButton; +}); \ No newline at end of file diff --git a/pos_product_creation/static/src/js/product_create_popup.js b/pos_product_creation/static/src/js/product_create_popup.js new file mode 100644 index 000000000..2764d25fc --- /dev/null +++ b/pos_product_creation/static/src/js/product_create_popup.js @@ -0,0 +1,53 @@ +odoo.define('pos_product_creation.product_create_popup', function(require) { + 'use strict'; + const { + useState, + useRef + } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + + class ProductCreatePopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + console.log(this.env.pos, '<<<<<<<<<<<<<<<') + this.state = useState({ + typeValue: this.props.startingValue, + productValue: this.props.startingValue, + priceValue: this.props.priceValue, + productRef: this.props.startingValue + }); + } + getPayload() { + var selected_vals = []; + var category = this.state.typeValue; + var product = this.state.productValue; + var product_reference = this.state.productRef; + var price = this.state.priceValue; + var unit = this.state.unitValue; + var product_category = this.state.categoryValue; + selected_vals.push(category); + selected_vals.push(product); + selected_vals.push(product_reference); + selected_vals.push(price); + selected_vals.push(unit); + selected_vals.push(product_category); + return selected_vals + } + } + + ProductCreatePopup.defaultProps = { + confirmText: 'Ok', + cancelText: 'Cancel', + array: [], + title: 'Create ?', + body: '', + startingValue: '', + priceValue: 1, + list: [], + }; + ProductCreatePopup.template = 'ProductCreatePopup'; + Registries.Component.add(ProductCreatePopup); + + return ProductCreatePopup; +}); \ No newline at end of file diff --git a/pos_product_creation/static/src/xml/product_create_button.xml b/pos_product_creation/static/src/xml/product_create_button.xml new file mode 100644 index 000000000..b5586f869 --- /dev/null +++ b/pos_product_creation/static/src/xml/product_create_button.xml @@ -0,0 +1,11 @@ + + + + + + + Create Product + + + + diff --git a/pos_product_creation/static/src/xml/product_create_popup.xml b/pos_product_creation/static/src/xml/product_create_popup.xml new file mode 100644 index 000000000..85d4c49f1 --- /dev/null +++ b/pos_product_creation/static/src/xml/product_create_popup.xml @@ -0,0 +1,93 @@ + + + + + + \ No newline at end of file diff --git a/pos_product_creation/views/assets.xml b/pos_product_creation/views/assets.xml new file mode 100644 index 000000000..ced8a5a22 --- /dev/null +++ b/pos_product_creation/views/assets.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file