[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:
parent
5585a38ecc
commit
e2f2381fc2
|
@ -182,7 +182,7 @@ class EscposDriver(Thread):
|
||||||
if check(receipt['shop']['name']):
|
if check(receipt['shop']['name']):
|
||||||
eprint.text(receipt['shop']['name'] + '\n')
|
eprint.text(receipt['shop']['name'] + '\n')
|
||||||
if check(receipt['company']['contact_address']):
|
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']):
|
if check(receipt['company']['phone']):
|
||||||
eprint.text('Tel:' + receipt['company']['phone'] + '\n')
|
eprint.text('Tel:' + receipt['company']['phone'] + '\n')
|
||||||
if check(receipt['company']['vat']):
|
if check(receipt['company']['vat']):
|
||||||
|
|
|
@ -145,7 +145,7 @@ function openerp_pos_db(instance, module){
|
||||||
for(var i = 0, len = products.length; i < len; i++){
|
for(var i = 0, len = products.length; i < len; i++){
|
||||||
var product = products[i];
|
var product = products[i];
|
||||||
var search_string = this._product_search_string(product);
|
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]){
|
if(!stored_categories[categ_id]){
|
||||||
stored_categories[categ_id] = [];
|
stored_categories[categ_id] = [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,14 +134,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||||
'phone',
|
'phone',
|
||||||
'partner_id',
|
'partner_id',
|
||||||
],
|
],
|
||||||
[['id','=',users[0].company_id[0]]]);
|
[['id','=',users[0].company_id[0]]],
|
||||||
|
{show_address_only: true});
|
||||||
}).then(function(companies){
|
}).then(function(companies){
|
||||||
self.company = companies[0];
|
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);
|
return self.fetch('product.uom', null, null);
|
||||||
}).then(function(units){
|
}).then(function(units){
|
||||||
self.units = units;
|
self.units = units;
|
||||||
|
@ -212,13 +209,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||||
}).then(function(packagings){
|
}).then(function(packagings){
|
||||||
self.db.add_packagings(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){
|
}).then(function(categories){
|
||||||
self.db.add_categories(categories);
|
self.db.add_categories(categories);
|
||||||
|
|
||||||
return self.fetch(
|
return self.fetch(
|
||||||
'product.product',
|
'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'],
|
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
|
||||||
[['sale_ok','=',true],['available_in_pos','=',true]],
|
[['sale_ok','=',true],['available_in_pos','=',true]],
|
||||||
{pricelist: self.pricelist.id} // context for price
|
{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,
|
email: company.email,
|
||||||
website: company.website,
|
website: company.website,
|
||||||
company_registry: company.company_registry,
|
company_registry: company.company_registry,
|
||||||
contact_address: company.contact_address,
|
contact_address: company.partner_id[1],
|
||||||
vat: company.vat,
|
vat: company.vat,
|
||||||
name: company.name,
|
name: company.name,
|
||||||
phone: company.phone,
|
phone: company.phone,
|
||||||
|
|
|
@ -436,7 +436,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
||||||
},
|
},
|
||||||
|
|
||||||
get_image_url: function(category){
|
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 ){
|
render_category: function( category, with_image ){
|
||||||
|
|
Loading…
Reference in New Issue