merge
This commit is contained in:
commit
06a1e783d7
4 files changed
+6
-21
No files matched your search
+3
-3
@@ -115,9 +115,9 @@ class Model(ModelSQL, ModelView):
|
||||
Property._models_get_cache.clear()
|
||||
|
||||
@classmethod
|
||||
def global_search(cls, text, limit):
|
||||
def global_search(cls, text, limit, menu='ir.ui.menu'):
|
||||
"""
|
||||
Search on models for text
|
||||
Search on models for text including menu
|
||||
Returns a list of tuple (ratio, model, model_name, id, rec_name, icon)
|
||||
The size of the list is limited to limit
|
||||
"""
|
||||
@@ -129,7 +129,7 @@ class Model(ModelSQL, ModelView):
|
||||
|
||||
models = cls.search(['OR',
|
||||
('global_search_p', '=', True),
|
||||
('name', '=', 'ir.ui.menu'),
|
||||
('model', '=', menu),
|
||||
])
|
||||
access = ModelAccess.get_access([m.model for m in models])
|
||||
s = StringMatcher()
|
||||
|
||||
@@ -36,7 +36,7 @@ class ModelSingleton(ModelStorage):
|
||||
+ cls._inherit_fields.keys()))
|
||||
for field_name in fields_names:
|
||||
if field_name not in res:
|
||||
res[field_name] = False
|
||||
res[field_name] = None
|
||||
res['id'] = ids[0]
|
||||
return [res]
|
||||
res = super(ModelSingleton, cls).read([singleton.id],
|
||||
|
||||
@@ -269,21 +269,6 @@ def load_module_graph(graph, pool, lang=None):
|
||||
|
||||
cursor.commit()
|
||||
|
||||
# Create missing reports
|
||||
from trytond.report import Report
|
||||
ActionReport = pool.get('ir.action.report')
|
||||
reports = ActionReport.search([
|
||||
('module', '=', module),
|
||||
])
|
||||
report_names = pool.object_name_list(type='report')
|
||||
for report in reports:
|
||||
report_name = report.report_name
|
||||
if report_name not in report_names:
|
||||
report = object.__new__(Report)
|
||||
report.__name__ = report_name
|
||||
pool.add(report, type='report')
|
||||
report.__init__()
|
||||
|
||||
for model_name in models_to_update_history:
|
||||
model = pool.get(model_name)
|
||||
if model._history:
|
||||
|
||||
@@ -40,8 +40,8 @@ class ModelSingletonTestCase(unittest.TestCase):
|
||||
])
|
||||
self.assertEqual(singleton['create_uid'], USER)
|
||||
self.assert_(isinstance(singleton['create_date'], datetime))
|
||||
self.assertEqual(singleton['write_uid'], False)
|
||||
self.assertEqual(singleton['write_date'], False)
|
||||
self.assertEqual(singleton['write_uid'], None)
|
||||
self.assertEqual(singleton['write_date'], None)
|
||||
|
||||
transaction.cursor.rollback()
|
||||
|
||||
|
||||
Reference in new issue
Block a user