New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎉1️⃣1️⃣ pos_product_sync #681
🎉1️⃣1️⃣ pos_product_sync #681
Conversation
res = super(ProductChangeQuantity, self).change_product_qty() | ||
product_ids = [] | ||
for wizard in self: | ||
product_ids.append(wizard.product_id.id ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace before ')'
if (this.product_by_id) { | ||
var self = this; | ||
var already_downloaded_products = _.filter(products, function(p){ | ||
return self.product_by_id[p.id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var already_downloaded_products = []; | ||
if (this.product_by_id) { | ||
var self = this; | ||
var already_downloaded_products = _.filter(products, function(p){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'already_downloaded_products' is already defined.
})); | ||
index = index > -1 | ||
? index | ||
: product_list.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
return p.id == prod_id; | ||
})); | ||
index = index > -1 | ||
? index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '?'; readers may interpret this as an expression boundary.
if (product.barcode) { | ||
delete self.db.products_by_barcode[product.barcode]; | ||
} | ||
delete self.db.products_by_id[p_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
: product_list.length | ||
product = self.pos.db.get_product_by_id(prod_id); | ||
if (product.available_in_pos && mode !== 'remove') { | ||
product_list[index] = product; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'index' is not defined no-undef
})); | ||
index = index > -1 | ||
? index | ||
: product_list.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
return p.id == prod_id; | ||
})); | ||
index = index > -1 | ||
? index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'index' is not defined no-undef
index = _.indexOf(product_list, _.find(product_list, function(p){ | ||
return p.id == prod_id; | ||
})); | ||
index = index > -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'index' is not defined no-undef
Implicit global variable, assign as global property instead no-implicit-globals
var product = false; | ||
_.each(product_ids, function(prod_id) { | ||
index = _.indexOf(product_list, _.find(product_list, function(p){ | ||
return p.id == prod_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '===' and instead saw '==' eqeqeq
…ble-customization 11.0 pos product avilable customization
…into pos-addons-11.0-pos_product_sync
@@ -41,9 +45,34 @@ odoo.define('pos_product_available_negative.pos', function (require) { | |||
models.Order = models.Order.extend({ | |||
export_as_JSON: function () { | |||
var json = _super_order.export_as_JSON.apply(this, arguments); | |||
json.negative_stock_user_id = this.negative_stock_user_id ? this.negative_stock_user_id.id : false; | |||
json.negative_stock_user_id = this.negative_stock_user_id | |||
? this.negative_stock_user_id.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '?'; readers may interpret this as an expression boundary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pos_product_sync:
- The product name, price and image are not updated.
- if the product barcode is changed, the product is available by both barcodes (old and new) before refresh the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all fields are synchronized, the longpolling icon will turn red in another POS after updating the number of products in the POS.
1 confirmed if you change product.template model. Name and price are synchronized if you change product.product model (product variant). Image does not work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 installable modules are updated:
├─ pos_product_available/
| ├─ __init__.py
| ├─ __manifest__.py
| ├─ doc/
| | └─ changelog.rst
| ├─ models/
| | ├─ __init__.py
| | └─ models.py
| ├─ static/
| | └─ src/
| | └─ xml/
| | └─ pos.xml
| └─ views/
| └─ views.xml
├─ pos_product_available_negative/
| ├─ __manifest__.py
| ├─ doc/
| | └─ changelog.rst
| ├─ models.py
| ├─ static/
| | └─ src/
| | └─ js/
| | └─ pos.js
| └─ views.xml
└─ pos_product_sync/
├─ README.rst
├─ __init__.py
├─ __manifest__.py
├─ doc/
| ├─ changelog.rst
| └─ index.rst
├─ models/
| ├─ __init__.py
| ├─ pos_config_settings.py
| └─ product_product.py
├─ static/
| ├─ description/
| | └─ icon.png
| └─ src/
| └─ js/
| ├─ pos_product_sync.js
| └─ test_pos_opens.js
├─ tests/
| ├─ __init__.py
| └─ default_test.py
└─ views/
├─ assets.xml
└─ pos_config.xml
Not installable modules remain unchanged.
sent by ✌️ Odoo Review Bot
@@ -1,7 +1,7 @@ | |||
.. _changelog: | |||
`1.1.0` | |||
------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be tested
@@ -1,7 +1,9 @@ | |||
.. _changelog: | |||
`1.1.0` | |||
------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be tested
`1.0.0` | ||
------- | ||
|
||
- Init version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be tested
var product_list = this.product_list; | ||
var product = false; | ||
_.each(product_ids, function(prod_id) { | ||
index = _.indexOf(product_list, _.find(product_list, function(p){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'index' is not defined no-undef
Implicit global variable, assign as global property instead no-implicit-globals
if (product.barcode) { | ||
delete self.db.products_by_barcode[product.barcode]; | ||
} | ||
delete self.db.products_by_id[p_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
}); | ||
var orderline = false; | ||
while ( i < orderlines.length ) { | ||
orderline = orderlines[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'i' is not defined no-undef
return _.contains(product_ids, ol.get_product().id); | ||
}); | ||
var orderline = false; | ||
while ( i < orderlines.length ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'i' is not defined no-undef
}, { | ||
shadow: true, | ||
}).then(function(products) { | ||
product_model.loaded(self, products) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
superseded by #735 |
No description provided.