Total Complexity | 2 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
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 |