Browse Source

[IMP] base_custom_info: Tests

12.0-mig-module_prototyper_last
Alexandre Díaz 5 years ago
parent
commit
153e1d0134
  1. 1
      base_custom_info/models/custom_info.py
  2. 2
      base_custom_info/tests/test_partner.py
  3. 11
      base_custom_info/views/custom_info_value_view.xml

1
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

2
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):

11
base_custom_info/views/custom_info_value_view.xml

@ -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"

Loading…
Cancel
Save