|
@@ -23,8 +23,10 @@ export class ProductTemplateSyncProvider {
|
|
|
console.log('product_template: new products sended');
|
|
|
return this.getUpdatedProducts();
|
|
|
}).then(products => {
|
|
|
+ console.log(products);
|
|
|
+
|
|
|
return this.odooProvider.put("product_template", products);
|
|
|
- }).then(() => {
|
|
|
+ }).then(response => {
|
|
|
console.log('product_template: modified products sended');
|
|
|
return this.getDeletedProducts();
|
|
|
}).then(products => {
|
|
@@ -67,7 +69,7 @@ export class ProductTemplateSyncProvider {
|
|
|
let products = templates.filter(item => {
|
|
|
return item.doc_state === "updated" && item.remote_id;
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
resolve(products.map(item => {
|
|
|
delete item.id;
|
|
|
return item;
|
|
@@ -106,9 +108,6 @@ export class ProductTemplateSyncProvider {
|
|
|
this.dataProvider.deleteAll(DataProvider.DOCS.PRODUCT_TEMPLATE).then(() => {
|
|
|
return;
|
|
|
}).then(() => {
|
|
|
- console.log(products);
|
|
|
-
|
|
|
-
|
|
|
return this.dataProvider.save(DataProvider.DOCS.PRODUCT_TEMPLATE, products.map(item => {
|
|
|
item.remote_id = item.id;
|
|
|
item.doc_state = "sync";
|