Skip to content
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

Conversation

KolushovAlexandr
Copy link

No description provided.

res = super(ProductChangeQuantity, self).change_product_qty()
product_ids = []
for wizard in self:
product_ids.append(wizard.product_id.id )
Copy link

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]
Copy link

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){
Copy link

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
Copy link

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
Copy link

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]
Copy link

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;
Copy link

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
Copy link

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
Copy link

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
Copy link

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;
Copy link

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

Ivan Yelizariev and others added 2 commits July 16, 2019 09:37
…ble-customization

11.0 pos product avilable customization
@@ -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
Copy link

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.

Copy link

@Ramil-Mukhametzyanov Ramil-Mukhametzyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pos_product_sync:

  1. The product name, price and image are not updated.
  2. if the product barcode is changed, the product is available by both barcodes (old and new) before refresh the page.

Copy link

@Ramil-Mukhametzyanov Ramil-Mukhametzyanov left a 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.

@KolushovAlexandr
Copy link
Author

pos_product_sync:

  1. The product name, price and image are not updated.
  2. if the product barcode is changed, the product is available by both barcodes (old and new) before refresh the page.

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
2 confirmed

Copy link

@itpp-bot itpp-bot left a 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`
-------

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`
-------

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

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){
Copy link

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]
Copy link

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];
Copy link

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 ) {
Copy link

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

@KolushovAlexandr
Copy link
Author

superseded by #735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants