Beispiel #1
0
    def search(cls,
               domain,
               offset=0,
               limit=None,
               order=None,
               count=False,
               query=False):
        transaction = Transaction().context

        party = transaction.get('party')
        date = transaction.get('date')

        domain = domain[:]
        if party is not None:
            domain = [domain, ('party', '=', party)]
        if date is not None:
            domain = [domain, ('date', '=', date)]

        records = super(Expense, cls).search(domain,
                                             offset=offset,
                                             limit=limit,
                                             order=order,
                                             count=count,
                                             query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #2
0
 def _key(self, key):
     if self.context:
         context = Transaction().context.copy()
         context.pop('client', None)
         context.pop('_request', None)
         return (key, Transaction().user, freeze(context))
     return key
Beispiel #3
0
    def search(cls, domain, offset=0, limit=None, order=None, count=False,
            query=False):
        #pool = Pool() 
        #Subscription = pool.get('sale.subscription')
        transaction = Transaction().context 
        horario = transaction.get('horario')
        estudiante = transaction.get('estudiante')
        suscriptor = transaction.get('suscriptor')
        course = transaction.get('course')
        
        domain = domain[:]
        #if horario is not None: 
        #    domain = [domain, ('horario','=',horario)]
        if estudiante is not None: 
            domain = [domain, ('estudiante','=',estudiante)]
        if suscriptor is not None: 
            domain = [domain, ('party','=',suscriptor)]
        if course is not None: 
            domain = [domain, ('lines.service','=',course)]

        records = super(Subscription, cls).search(domain, offset=offset, limit=limit,
             order=order, count=count, query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #4
0
    def search(cls,
               domain,
               offset=0,
               limit=None,
               order=None,
               count=False,
               query=False):
        transaction = Transaction().context

        student = transaction.get('student')
        subscriber = transaction.get('subscriber')
        course = transaction.get('course')

        domain = domain[:]
        if student is not None:
            domain = [domain, ('student', '=', student)]
        if subscriber is not None:
            domain = [domain, ('party', '=', subscriber)]
        if course is not None:
            domain = [domain, ('lines.service', '=', course)]

        records = super(Subscription, cls).search(domain,
                                                  offset=offset,
                                                  limit=limit,
                                                  order=order,
                                                  count=count,
                                                  query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #5
0
 def _key(self, key):
     if self.context:
         # Remove client key from cache's context.
         # See redmine issue #19794
         context = Transaction().context.copy()
         for to_pop in {'client', '_request', 'session', 'token'}:
             context.pop(to_pop, None)
         return (key, Transaction().user, freeze(context))
     return key
Beispiel #6
0
    def search(cls, domain, offset=0, limit=None, order=None, count=False,
            query=False):
        transaction = Transaction().context 
        
        party = transaction.get('party')
        date = transaction.get('date')
        
        domain = domain[:]
        if party is not None: 
            domain = [domain, ('party','=',party)]
        if date is not None:  
            domain = [domain, ('date','=',date)] 

        records = super(Expense, cls).search(domain, offset=offset, limit=limit,
             order=order, count=count, query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential 
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #7
0
    def search(cls,
               domain,
               offset=0,
               limit=None,
               order=None,
               count=False,
               query=False):
        #pool = Pool()
        #Subscription = pool.get('sale.subscription')
        transaction = Transaction().context
        horario = transaction.get('horario')
        estudiante = transaction.get('estudiante')
        suscriptor = transaction.get('suscriptor')
        course = transaction.get('course')

        domain = domain[:]
        #if horario is not None:
        #    domain = [domain, ('horario','=',horario)]
        if estudiante is not None:
            domain = [domain, ('estudiante', '=', estudiante)]
        if suscriptor is not None:
            domain = [domain, ('party', '=', suscriptor)]
        if course is not None:
            domain = [domain, ('lines.service', '=', course)]

        records = super(Subscription, cls).search(domain,
                                                  offset=offset,
                                                  limit=limit,
                                                  order=order,
                                                  count=count,
                                                  query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #8
0
    def search(cls, domain, offset=0, limit=None, order=None, count=False,
            query=False):
        if Transaction().user:
            domain = domain[:]
            domain = [domain,
                ['OR',
                    [
                        ('classification', '=', 'private'),
                        ['OR',
                            ('calendar.owner', '=', Transaction().user),
                            ('calendar.write_users', '=', Transaction().user),
                            ],
                        ],
                    ('classification', '!=', 'private'),
                    ],
                ]
        records = super(Event, cls).search(domain, offset=offset, limit=limit,
            order=order, count=count, query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #9
0
    def search(cls, domain, offset=0, limit=None, order=None, count=False,
            query=False):
        if Transaction().user:
            domain = domain[:]
            domain = [domain,
                ['OR',
                    [
                        ('classification', '=', 'private'),
                        ['OR',
                            ('calendar.owner', '=', Transaction().user),
                            ('calendar.write_users', '=', Transaction().user),
                            ],
                        ],
                    ('classification', '!=', 'private'),
                    ],
                ]
        records = super(Event, cls).search(domain, offset=offset, limit=limit,
            order=order, count=count, query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential
            cache = Transaction().cursor.get_cache()
            cache.pop(cls.__name__, None)
        return records
Beispiel #10
0
    def search(cls, domain, offset=0, limit=None, order=None, count=False,
            query=False):
        transaction = Transaction().context 
        
        student = transaction.get('student')
        subscriber = transaction.get('subscriber')
        course = transaction.get('course')
        
        domain = domain[:]
        if student is not None: 
            domain = [domain, ('student','=',student)]
        if subscriber is not None: 
            domain = [domain, ('party','=',subscriber)] 
        if course is not None:  
            domain = [domain, ('lines.service','=',course)] 

        records = super(Subscription, cls).search(domain, offset=offset, limit=limit,
             order=order, count=count, query=query)

        if Transaction().user:
            # Clear the cache as it was not cleaned for confidential 
            cache = Transaction().get_cache()
            cache.pop(cls.__name__, None)
        return records