Skip to content

Commit

Permalink
[IMP] base_custom_info: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tardo committed Dec 18, 2019
1 parent 339a8ec commit 153e1d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions base_custom_info/models/custom_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _onchange_custom_info_template_id(self):
"res_id": self.id,
"value": prop.default_value,
})
newvalue._onchange_property_set_default_value()
newvalue._inverse_value()
newvalue._compute_value()
values += newvalue
Expand Down
2 changes: 2 additions & 0 deletions base_custom_info/tests/test_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -82,6 +83,7 @@ def test_template_model_and_model_id_match(self):
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):
Expand Down
11 changes: 7 additions & 4 deletions base_custom_info/views/custom_info_value_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@
<field name="res_id"/>
<field name="category_id"/>
<field name="property_id"/>
<field name="value"/>
<group expand="0" string="Group By">
<filter
string="Owner"
name="owner"
context="{'group_by': ['model' , 'res_id']}"/>
string="Model"
name="model"
context="{'group_by': 'model'}"/>
<filter
string="Resource"
name="resource"
context="{'group_by': 'res_id'}"/>
<filter
string="Category"
name="category"
Expand Down

0 comments on commit 153e1d0

Please sign in to comment.