From d1854068e9fecd9917e80c3c9a9f78e469b6be2d Mon Sep 17 00:00:00 2001 From: "Luis M. Ontalba" Date: Thu, 30 Nov 2017 22:13:51 +0100 Subject: [PATCH] [10.0][FIX] stock_valued_picking_report: Fix report (#38) --- stock_valued_picking_report/README.rst | 1 + stock_valued_picking_report/__manifest__.py | 2 +- .../report/stock_picking_valued_report.xml | 2 +- .../tests/test_stock_picking_valued.py | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/stock_valued_picking_report/README.rst b/stock_valued_picking_report/README.rst index 44fcad9..5bb5bfe 100644 --- a/stock_valued_picking_report/README.rst +++ b/stock_valued_picking_report/README.rst @@ -60,6 +60,7 @@ Contributors * Oihane Crucelaegui * Carlos Dauden * David Vidal +* Luis M. Ontalba Maintainer ---------- diff --git a/stock_valued_picking_report/__manifest__.py b/stock_valued_picking_report/__manifest__.py index 416841c..9257f0d 100644 --- a/stock_valued_picking_report/__manifest__.py +++ b/stock_valued_picking_report/__manifest__.py @@ -8,7 +8,7 @@ { "name": "Stock Valued Picking Report", "summary": "Adding Valued Picking on Delivery Slip report", - "version": "10.0.1.0.0", + "version": "10.0.1.0.1", "author": "Tecnativa, " "Odoo Community Association (OCA)", "website": "https://www.tecnativa.com", diff --git a/stock_valued_picking_report/report/stock_picking_valued_report.xml b/stock_valued_picking_report/report/stock_picking_valued_report.xml index d8d2cac..c1e602d 100644 --- a/stock_valued_picking_report/report/stock_picking_valued_report.xml +++ b/stock_valued_picking_report/report/stock_picking_valued_report.xml @@ -13,7 +13,7 @@ Taxes - + diff --git a/stock_valued_picking_report/tests/test_stock_picking_valued.py b/stock_valued_picking_report/tests/test_stock_picking_valued.py index 1b26106..432ea03 100644 --- a/stock_valued_picking_report/tests/test_stock_picking_valued.py +++ b/stock_valued_picking_report/tests/test_stock_picking_valued.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Copyright 2017 Tecnativa - David Vidal +# Copyright 2017 Tecnativa - Luis M. Ontalba # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests import common @@ -27,7 +28,10 @@ class TestStockPickingValued(common.SavepointCase): cls.sale_order = cls.env['sale.order'].create({ 'partner_id': cls.partner.id, 'order_line': [(0, 0, {'product_id': cls.product.id})], + 'company_id': cls.env.user.company_id.id, }) + cls.sale_order.company_id.tax_calculation_rounding_method = ( + 'round_per_line') def test_01_confirm_order(self): self.assertTrue(self.partner.valued_picking) @@ -46,3 +50,13 @@ class TestStockPickingValued(common.SavepointCase): self.assertEqual(picking.amount_untaxed, 0.0) self.assertEqual(picking.amount_tax, 0.0) self.assertEqual(picking.amount_total, 0.0) + + def test_03_tax_rounding_method(self): + self.sale_order.company_id.tax_calculation_rounding_method = ( + 'round_globally') + self.sale_order.action_confirm() + self.assertTrue(len(self.sale_order.picking_ids)) + for picking in self.sale_order.picking_ids: + self.assertEqual(picking.amount_untaxed, 100.0) + self.assertEqual(picking.amount_tax, 15.0) + self.assertEqual(picking.amount_total, 115.0)