Merge pull request #59 from Tecnativa/11.0-FIX-stock_picking_report_valued-tax_round

[FIX] stock_picking_report_valued: Remove round_method condition because don't apply here
This commit is contained in:
Pedro M. Baeza
2019-06-13 12:53:22 +02:00
committed by GitHub
3 changed files with 8 additions and 15 deletions

View File

@@ -8,7 +8,7 @@
{
"name": "Valued Picking Report",
"summary": "Adding Valued Picking on Delivery Slip report",
"version": "11.0.1.0.1",
"version": "11.0.1.0.2",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"website": "https://www.tecnativa.com",

View File

@@ -64,7 +64,8 @@ class StockMoveLine(models.Model):
"""
for line in self:
taxes = line.sale_tax_id.compute_all(
price_unit=line.sale_line.price_reduce,
price_unit=line.sale_line.price_subtotal / (
line.sale_line.product_uom_qty or 0.0),
currency=line.currency_id,
quantity=line.qty_done or line.product_qty,
product=line.product_id,

View File

@@ -41,19 +41,11 @@ class StockPicking(models.Model):
records...).
"""
for pick in self:
sale = pick.sale_id
round_method = sale.company_id.tax_calculation_rounding_method
if round_method == 'round_globally':
amount_untaxed = sum(pick.move_line_ids.mapped(
'sale_price_subtotal'))
amount_tax = sum(pick.move_line_ids.mapped(
'sale_price_tax'))
else:
round_curr = sale.currency_id.round
amount_untaxed = amount_tax = 0.0
for tax_id, tax_group in pick.get_taxes_values().items():
amount_untaxed += round_curr(tax_group['base'])
amount_tax += round_curr(tax_group['amount'])
round_curr = pick.sale_id.currency_id.round
amount_untaxed = amount_tax = 0.0
for tax_id, tax_group in pick.get_taxes_values().items():
amount_untaxed += round_curr(tax_group['base'])
amount_tax += round_curr(tax_group['amount'])
pick.update({
'amount_untaxed': amount_untaxed,
'amount_tax': amount_tax,