Skip to content
Snippets Groups Projects
entities.py 413 B
Newer Older
Sylvain's avatar
Sylvain committed
"""this contains the template-specific entities' classes"""

from cubes.expense.entities import ExpenseLine as BaseExpenseLine
Sylvain's avatar
Sylvain committed

class ExpenseLine(BaseExpenseLine):

Sylvain's avatar
Sylvain committed
    @property
    def workcase(self):
        rql = 'Any R WHERE E has_lines EL, EL eid %(el)s, E spent_for W, W ref R'
Sylvain Thénault's avatar
Sylvain Thénault committed
        rset = self._cw.execute(rql, {'el': self.eid}, 'el')
Sylvain's avatar
Sylvain committed
        if rset:
            return rset[0][0]
        return None