[MERGE] forward port branch 10.0 up to 6c1c1f6e9e
This commit is contained in:
@@ -835,7 +835,7 @@ class AccountTax(models.Model):
|
||||
incl_fixed_amount = incl_percent_amount = 0
|
||||
if tax.price_include:
|
||||
if tax.amount_type == 'fixed':
|
||||
incl_fixed_amount += tax.amount
|
||||
incl_fixed_amount += quantity * tax.amount
|
||||
elif tax.amount_type == 'percent':
|
||||
incl_percent_amount += tax.amount
|
||||
# Start the computation of accumulated amounts at the total_excluded value.
|
||||
|
||||
@@ -232,6 +232,22 @@ class TestTax(AccountTestUsers):
|
||||
res
|
||||
)
|
||||
|
||||
self.fixed_tax.price_include = True
|
||||
self.fixed_tax.include_base_amount = False
|
||||
res = self.fixed_tax.compute_all(100.0, quantity=2.0)
|
||||
self._check_compute_all_results(
|
||||
180, # 'base'
|
||||
200, # 'total_included'
|
||||
180, # 'total_excluded'
|
||||
[
|
||||
# base , amount | seq | amount | incl | incl_base
|
||||
# ---------------------------------------------------
|
||||
(180.0, 20.0), # | 1 | 20 | | t
|
||||
# ---------------------------------------------------
|
||||
],
|
||||
res
|
||||
)
|
||||
|
||||
def test_tax_include_base_amount_2(self):
|
||||
self.percent_tax.price_include = True
|
||||
self.percent_tax.amount = 21.0
|
||||
|
||||
@@ -725,10 +725,10 @@ exports.PosModel = Backbone.Model.extend({
|
||||
// generate the pdf and download it
|
||||
self.chrome.do_action('point_of_sale.pos_invoice_report',{additional_context:{
|
||||
active_ids:order_server_id,
|
||||
}});
|
||||
|
||||
invoiced.resolve();
|
||||
done.resolve();
|
||||
}}).done(function () {
|
||||
invoiced.resolve();
|
||||
done.resolve();
|
||||
});
|
||||
});
|
||||
|
||||
return done;
|
||||
@@ -1502,7 +1502,7 @@ exports.Orderline = Backbone.Model.extend({
|
||||
}
|
||||
if(tax.price_include){
|
||||
if(tax.amount_type === 'fixed')
|
||||
incl_fixed_amount += tax.amount;
|
||||
incl_fixed_amount += quantity * tax.amount;
|
||||
else if(tax.amount_type === 'percent')
|
||||
incl_percent_amount += tax.amount;
|
||||
}
|
||||
@@ -1518,7 +1518,7 @@ exports.Orderline = Backbone.Model.extend({
|
||||
var amount = self._compute_all(tax, base, quantity, false);
|
||||
|
||||
if(!tax.price_include || base_gaps.length == 0)
|
||||
return tax_amount;
|
||||
return amount;
|
||||
|
||||
var new_gap = base_gaps[base_gaps.length - 1] - amount;
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ odoo.define("sale_stock.tour", function (require) {
|
||||
auto: true,
|
||||
in_modal: false,
|
||||
run: function (actions) {
|
||||
actions.auto(".modal-footer .btn-primary");
|
||||
if ($('.modal-footer .btn-primary').length){
|
||||
actions.auto(".modal-footer .btn-primary");
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user