This file is indexed.

/usr/lib/python2.7/dist-packages/trytond/modules/sale_opportunity/sale.py is in tryton-modules-sale-opportunity 4.2.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This file is part of Tryton.  The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from functools import wraps

from trytond.pool import PoolMeta, Pool
from trytond.transaction import Transaction

__all__ = ['Sale']


def process_opportunity(func):
    @wraps(func)
    def wrapper(cls, sales):
        pool = Pool()
        Opportunity = pool.get('sale.opportunity')
        with Transaction().set_context(_check_access=False):
            opportunities = [s.origin for s in cls.browse(sales)
                if isinstance(s.origin, Opportunity)]
        func(cls, sales)
        with Transaction().set_context(_check_access=False):
            Opportunity.process(opportunities)
    return wrapper


class Sale:
    __metaclass__ = PoolMeta
    __name__ = 'sale.sale'

    @classmethod
    def _get_origin(cls):
        return super(Sale, cls)._get_origin() + ['sale.opportunity']

    @classmethod
    @process_opportunity
    def delete(cls, sales):
        super(Sale, cls).delete(sales)

    @classmethod
    @process_opportunity
    def cancel(cls, sales):
        super(Sale, cls).cancel(sales)

    @classmethod
    @process_opportunity
    def quote(cls, sales):
        super(Sale, cls).quote(sales)

    @classmethod
    @process_opportunity
    def confirm(cls, sales):
        super(Sale, cls).confirm(sales)

    @classmethod
    @process_opportunity
    def proceed(cls, sales):
        super(Sale, cls).proceed(sales)

    @classmethod
    @process_opportunity
    def do(cls, sales):
        super(Sale, cls).do(sales)