diff --git a/pos_product_creation/controllers/main.py b/pos_product_creation/controllers/main.py
index f36877e0d..4237d4157 100644
--- a/pos_product_creation/controllers/main.py
+++ b/pos_product_creation/controllers/main.py
@@ -27,7 +27,7 @@ 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):
+ def create_product(self, category, name, price, product_reference, unit_measure, product_categories, barcode, **kwargs):
product_category = ''
if category == 'Consumable':
product_category = 'consu'
@@ -46,5 +46,6 @@ class PosProductCreation(http.Controller):
'uom_po_id': int(unit_measure),
'categ_id': int(product_categories),
'available_in_pos': True,
+ 'barcode': barcode,
})
diff --git a/pos_product_creation/static/src/js/product_create_button.js b/pos_product_creation/static/src/js/product_create_button.js
index 711a4f0d1..7687acd19 100644
--- a/pos_product_creation/static/src/js/product_create_button.js
+++ b/pos_product_creation/static/src/js/product_create_button.js
@@ -30,11 +30,7 @@ odoo.define('owl_tutorials.product_create_button', function(require) {
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')
+ var barcode = payload[6];
if (!product_name){
return this.showPopup('ErrorPopup', {
title: _('A Unit Of Measure Is Required'),
@@ -52,6 +48,7 @@ odoo.define('owl_tutorials.product_create_button', function(require) {
'product_reference': product_reference,
'unit_measure': unit_measure,
'product_categories': product_categories,
+ 'barcode': barcode,
}).then(function(response) {});
}
}
diff --git a/pos_product_creation/static/src/js/product_create_popup.js b/pos_product_creation/static/src/js/product_create_popup.js
index 2764d25fc..ae963c82e 100644
--- a/pos_product_creation/static/src/js/product_create_popup.js
+++ b/pos_product_creation/static/src/js/product_create_popup.js
@@ -10,7 +10,6 @@ odoo.define('pos_product_creation.product_create_popup', function(require) {
class ProductCreatePopup extends AbstractAwaitablePopup {
constructor() {
super(...arguments);
- console.log(this.env.pos, '<<<<<<<<<<<<<<<')
this.state = useState({
typeValue: this.props.startingValue,
productValue: this.props.startingValue,
@@ -26,12 +25,14 @@ odoo.define('pos_product_creation.product_create_popup', function(require) {
var price = this.state.priceValue;
var unit = this.state.unitValue;
var product_category = this.state.categoryValue;
+ var barcode = this.state.barcodeValue;
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);
+ selected_vals.push(barcode);
return selected_vals
}
}
diff --git a/pos_product_creation/static/src/xml/product_create_popup.xml b/pos_product_creation/static/src/xml/product_create_popup.xml
index 85d4c49f1..031f2f1bb 100644
--- a/pos_product_creation/static/src/xml/product_create_popup.xml
+++ b/pos_product_creation/static/src/xml/product_create_popup.xml
@@ -75,6 +75,15 @@
+
+