From 153e1d013495fbe830228494914edbca06697746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Mon, 16 Dec 2019 13:17:56 +0100 Subject: [PATCH] [IMP] base_custom_info: Tests --- base_custom_info/models/custom_info.py | 1 + base_custom_info/tests/test_partner.py | 2 ++ base_custom_info/views/custom_info_value_view.xml | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/base_custom_info/models/custom_info.py b/base_custom_info/models/custom_info.py index fc805b828..7bf669b07 100644 --- a/base_custom_info/models/custom_info.py +++ b/base_custom_info/models/custom_info.py @@ -59,6 +59,7 @@ class CustomInfo(models.AbstractModel): "res_id": self.id, "value": prop.default_value, }) + newvalue._onchange_property_set_default_value() newvalue._inverse_value() newvalue._compute_value() values += newvalue diff --git a/base_custom_info/tests/test_partner.py b/base_custom_info/tests/test_partner.py index 3bb09de96..2635ad947 100644 --- a/base_custom_info/tests/test_partner.py +++ b/base_custom_info/tests/test_partner.py @@ -5,6 +5,7 @@ from psycopg2 import IntegrityError from odoo.exceptions import AccessError, ValidationError from odoo.tests.common import TransactionCase +from odoo.tools import mute_logger class PartnerCase(TransactionCase): @@ -82,6 +83,7 @@ class PartnerCase(TransactionCase): self.tpl.model = "res.users" self.assertEqual(self.tpl.model, self.tpl.model_id.model) + @mute_logger('odoo.sql_db') def test_template_model_must_exist(self): """Cannot create templates for unexisting models.""" with self.assertRaises(IntegrityError): diff --git a/base_custom_info/views/custom_info_value_view.xml b/base_custom_info/views/custom_info_value_view.xml index abc662b28..733d2572c 100644 --- a/base_custom_info/views/custom_info_value_view.xml +++ b/base_custom_info/views/custom_info_value_view.xml @@ -85,12 +85,15 @@ - + string="Model" + name="model" + context="{'group_by': 'model'}"/> +