summaryrefslogtreecommitdiff
path: root/addons/sale_mrp/tests/test_move_explode.py
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-02-25 13:44:25 +0100
committerNicolas Martinelli <nim@odoo.com>2016-02-25 15:46:09 +0100
commit16f698f6be1e9d20b8232900a8990f5383875c8b (patch)
tree92b8b529ab52360bb46c6793e8dabd0e592657c9 /addons/sale_mrp/tests/test_move_explode.py
parent67edccbc7f7169229c3dabfe13f9a334e0a27da9 (diff)
[FIX] sale_margin, delivery: margin at creation
The `purchase_price` is filled in automatically thanks to the onchange method `product_id_change_margin`. However, when a SO is created programatically, it is necessary to call manually the method in order to fill in the field. This is not convenient since the module sale_margin might not be installed, and crappy workaround (such as the use of `hasattr`) are necessary. To avoid this, this fix automatically computes the purchase price at creation if no value is provided.
Diffstat (limited to 'addons/sale_mrp/tests/test_move_explode.py')
-rw-r--r--addons/sale_mrp/tests/test_move_explode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/sale_mrp/tests/test_move_explode.py b/addons/sale_mrp/tests/test_move_explode.py
index a7e3bdea946..84a13aff959 100644
--- a/addons/sale_mrp/tests/test_move_explode.py
+++ b/addons/sale_mrp/tests/test_move_explode.py
@@ -48,7 +48,7 @@ class TestMoveExplode(common.TransactionCase):
'partner_shipping_id': self.partner.id,
'pricelist_id': self.pricelist.id,
}
- self.so = self.SaleOrder.create(vals=so_vals)
+ self.so = self.SaleOrder.create(so_vals)
sol_vals = {
'order_id': self.so.id,
'name': self.product_bom.name,
@@ -56,7 +56,7 @@ class TestMoveExplode(common.TransactionCase):
'product_uom': self.product_bom.uom_id.id,
'product_uom_qty': 1.0,
}
- self.SaleOrderLine.create(values=sol_vals)
+ self.SaleOrderLine.create(sol_vals)
#confirm sale order
self.so.action_confirm()
#get all move associated to that sale_order