[FIX] point_of_sale: fixing pos incompatibilities with the model changes in trunk-website-al

bzr revid: fva@openerp.com-20140127161005-2tntipu1x50kuhpz
This commit is contained in:
Frédéric van der Essen 2014-01-27 17:10:05 +01:00
parent 5585a38ecc
commit e2f2381fc2
4 changed files with 8 additions and 11 deletions

View File

@ -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']):

View File

@ -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] = [];
}

View File

@ -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,

View File

@ -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 ){