From e2f2381fc23678af91f90a5793180d806bda42af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Mon, 27 Jan 2014 17:10:05 +0100 Subject: [PATCH] [FIX] point_of_sale: fixing pos incompatibilities with the model changes in trunk-website-al bzr revid: fva@openerp.com-20140127161005-2tntipu1x50kuhpz --- addons/hw_escpos/controllers/main.py | 2 +- addons/point_of_sale/static/src/js/db.js | 2 +- addons/point_of_sale/static/src/js/models.js | 13 +++++-------- addons/point_of_sale/static/src/js/widgets.js | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py index 36e655cd465..f366d85980a 100644 --- a/addons/hw_escpos/controllers/main.py +++ b/addons/hw_escpos/controllers/main.py @@ -182,7 +182,7 @@ class EscposDriver(Thread): if check(receipt['shop']['name']): eprint.text(receipt['shop']['name'] + '\n') if check(receipt['company']['contact_address']): - eprint.text(receipt['company']['contact address'] + '\n') + eprint.text(receipt['company']['contact_address'] + '\n') if check(receipt['company']['phone']): eprint.text('Tel:' + receipt['company']['phone'] + '\n') if check(receipt['company']['vat']): diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index e4dc633e0f6..077a2399c55 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -145,7 +145,7 @@ function openerp_pos_db(instance, module){ for(var i = 0, len = products.length; i < len; i++){ var product = products[i]; var search_string = this._product_search_string(product); - var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id; + var categ_id = product.public_categ_id ? product.public_categ_id[0] : this.root_category_id; if(!stored_categories[categ_id]){ stored_categories[categ_id] = []; } diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f623b21374c..0a15e625b5d 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -134,14 +134,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal 'phone', 'partner_id', ], - [['id','=',users[0].company_id[0]]]); + [['id','=',users[0].company_id[0]]], + {show_address_only: true}); }).then(function(companies){ self.company = companies[0]; - return self.fetch('res.partner',['contact_address'],[['id','=',companies[0].partner_id[0]]]); - }).then(function(company_partners){ - self.company.contact_address = company_partners[0].contact_address; - return self.fetch('product.uom', null, null); }).then(function(units){ self.units = units; @@ -212,13 +209,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal }).then(function(packagings){ self.db.add_packagings(packagings); - return self.fetch('pos.category', ['id','name','parent_id','child_id','image']) + return self.fetch('product.public.category', ['id','name','parent_id','child_id','image']) }).then(function(categories){ self.db.add_categories(categories); return self.fetch( 'product.product', - ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', + ['name', 'list_price','price','public_categ_id', 'taxes_id', 'ean13', 'default_code', 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'], [['sale_ok','=',true],['available_in_pos','=',true]], {pricelist: self.pricelist.id} // context for price @@ -972,7 +969,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal email: company.email, website: company.website, company_registry: company.company_registry, - contact_address: company.contact_address, + contact_address: company.partner_id[1], vat: company.vat, name: company.name, phone: company.phone, diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index f887a537d39..f2a254593d1 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -436,7 +436,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa }, get_image_url: function(category){ - return window.location.origin + '/web/binary/image?model=pos.category&field=image_medium&id='+category.id; + return window.location.origin + '/web/binary/image?model=product.public.category&field=image_medium&id='+category.id; }, render_category: function( category, with_image ){