示例#1
0
 def _partner_use_in(self, aggr_ids, models):
     """ Check if there is no occurence of this group of partner in the selected model
         :param aggr_ids : stringified list of partner ids separated with a comma (sql array_agg)
         :param models : dict mapping a model name with its foreign key with res_partner table
     """
     return any(self.env[model].search_count([(field, 'in', aggr_ids)])
                for model, field in models.iteritems())
示例#2
0
 def _partner_use_in(self, aggr_ids, models):
     """ Check if there is no occurence of this group of partner in the selected model
         :param aggr_ids : stringified list of partner ids separated with a comma (sql array_agg)
         :param models : dict mapping a model name with its foreign key with res_partner table
     """
     return any(
         self.env[model].search_count([(field, 'in', aggr_ids)])
         for model, field in models.iteritems()
     )
示例#3
0
 def _update_models(self, models=None):
     update = False
     if not models:
         checklists = self.with_context(active_test=True).search([])
         models = {
             checklist.model_id: checklist
             for checklist in checklists
         }
     for model, checklist in models.iteritems():
         if model.model not in self.env.registry.models:
             continue
         if checklist:
             update |= self._patch_model_decoration(model.model)
         else:
             update |= self._revert_model_decoration(model.model)
     if update:
         if self.pool.ready:
             RegistryManager.signal_registry_change(self._cr.dbname)
         self.clear_caches()