actions.py 644 Bytes
Newer Older
Sylvain's avatar
Sylvain committed
1
2
3
"""specific actions for fresh template

:organization: Logilab
Nicolas Chauvat's avatar
Nicolas Chauvat committed
4
:copyright: 2008-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
Sylvain's avatar
Sylvain committed
5
6
7
8
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"

Nsukami Patrick's avatar
Nsukami Patrick committed
9
10
from cubicweb import _
from cubicweb.predicates import is_instance
sylvain.thenault@logilab.fr's avatar
sylvain.thenault@logilab.fr committed
11
from cubicweb.web.action import Action
Sylvain's avatar
Sylvain committed
12

sylvain.thenault@logilab.fr's avatar
sylvain.thenault@logilab.fr committed
13
class AccountingAction(Action):
Sylvain Thénault's avatar
Sylvain Thénault committed
14
    __regid__ = 'accaction'
Sylvain Thénault's avatar
Sylvain Thénault committed
15
    __select__ = is_instance('Expense')
Sylvain's avatar
Sylvain committed
16
    title = _('generate accounting entries')
sylvain.thenault@logilab.fr's avatar
sylvain.thenault@logilab.fr committed
17

Sylvain's avatar
Sylvain committed
18
    def url(self):
Sylvain Thénault's avatar
Sylvain Thénault committed
19
        entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
Adrien Di Mascio's avatar
Adrien Di Mascio committed
20
        return entity.absolute_url(vid='accexpense')
Sylvain's avatar
Sylvain committed
21