From 2618f13fc72090a465c7b47e6fea0489c6814a21 Mon Sep 17 00:00:00 2001 From: Ernesto Tejeda Date: Mon, 6 Apr 2020 13:19:40 -0400 Subject: [PATCH] [FIX] account_asset_management: Fix tests --- .../tests/test_account_asset_management.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/account_asset_management/tests/test_account_asset_management.py b/account_asset_management/tests/test_account_asset_management.py index 984d858fe..4a0c3c683 100644 --- a/account_asset_management/tests/test_account_asset_management.py +++ b/account_asset_management/tests/test_account_asset_management.py @@ -445,8 +445,11 @@ class TestAssetManagement(SavepointCase): self.assertTrue(len(invoice.invoice_line_ids) > 0) line = invoice.invoice_line_ids[0] self.assertTrue(line.price_unit > 0.0) - line.quantity = 2 - line.asset_profile_id = asset_profile + move_form = Form(invoice) + with move_form.invoice_line_ids.edit(0) as line_form: + line_form.quantity = 2 + line_form.asset_profile_id = asset_profile + invoice = move_form.save() invoice.post() # I get all asset after invoice validation current_asset = self.env["account.asset"].search([])