[FIX] point_of_sale: currency should be fetched from the pricelist instead of the company

bzr revid: fva@openerp.com-20130918122836-pqi1w41swu4rcrga
This commit is contained in:
Frédéric van der Essen
2013-09-18 14:28:36 +02:00
parent ff9e90fad6
commit 645c3ccf65
+9 -4
View File
@@ -51,6 +51,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
'pos_config': null,
'units': null,
'units_by_id': null,
'pricelist': null,
'selectedOrder': null,
});
@@ -102,10 +103,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
}).then(function(company_partners){
self.get('company').contact_address = company_partners[0].contact_address;
return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('company').currency_id[0]]]);
}).then(function(currencies){
self.set('currency',currencies[0]);
return self.fetch('product.uom', null, null);
}).then(function(units){
self.set('units',units);
@@ -160,6 +157,14 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
}).then(function(shops){
self.set('shop',shops[0]);
return self.fetch('product.pricelist',['currency_id'],[['id','=',self.get('shop').pricelist_id[0]]]);
}).then(function(pricelists){
self.set('pricelist',pricelists[0]);
return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('pricelist').currency_id[0]]]);
}).then(function(currencies){
self.set('currency',currencies[0]);
return self.fetch('product.packaging',['ean','product_id']);
}).then(function(packagings){
self.db.add_packagings(packagings);