Passed
Push — master ( babb16...96e596 )
by Jordi
04:46
created

ClientOrdersView.__init__()   A

Complexity

Conditions 1

Size

Total Lines 17
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nop 3
1
# -*- coding: utf-8 -*-
2
#
3
# This file is part of SENAITE.CORE
4
#
5
# Copyright 2018 by it's authors.
6
# Some rights reserved. See LICENSE.rst, CONTRIBUTORS.rst.
7
8
from bika.lims import api
9
from bika.lims import bikaMessageFactory as _
10
from bika.lims.browser.supplyorderfolder import SupplyOrderFolderView
11
from bika.lims.permissions import AddSupplyOrder
12
13
14
class ClientOrdersView(SupplyOrderFolderView):
15
    """Client supply order listing
16
    """
17
18
    def __init__(self, context, request):
19
        super(ClientOrdersView, self).__init__(context, request)
20
21
        self.contentFilter = {
22
            "portal_type": "SupplyOrder",
23
            "sort_on": "sortable_title",
24
            "sort_order": "ascending",
25
            "path": {
26
                "query": api.get_path(context),
27
                "level": 0
28
            }
29
        }
30
        self.context_actions = {
31
            _("Add"): {
32
                "url": "createObject?type_name=SupplyOrder",
33
                "permission": AddSupplyOrder,
34
                "icon": "++resource++bika.lims.images/add.png"
35
            }
36
        }
37
38
    def before_render(self):
39
        """Before template render hook
40
        """
41