[FIX] point of sale: Rounding method

By default, the point of sale awlways uses the rounding method per line.
But the accounting configuration allows to use the globally rounding method,
this is why the point of sale must consider this configuration.
Inspired from the compute_all of account.tax model within
addons/account/account.py.

opw:632537
This commit is contained in:
Goffin Simon 2015-04-17 11:46:11 +02:00
parent 3557fe124a
commit fc132665d7
1 changed files with 4 additions and 1 deletions

View File

@ -135,7 +135,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
loaded: function(self,users){ self.user = users[0]; },
},{
model: 'res.company',
fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id'],
fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'tax_calculation_rounding_method'],
ids: function(self){ return [self.user.company_id[0]] },
loaded: function(self,companies){ self.company = companies[0]; },
},{
@ -861,6 +861,9 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
var self = this;
var res = [];
var currency_rounding = this.pos.currency.rounding;
if (this.pos.company.tax_calculation_rounding_method == "round_globally"){
currency_rounding = currency_rounding * 0.00001;
}
var base = price_unit;
_(taxes).each(function(tax) {
if (tax.price_include) {