Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | |||
3 | from senaite.core.browser.listing.actions import BaseActionView |
||
4 | |||
5 | |||
6 | class ActionView(BaseActionView): |
||
7 | """Action View for Analyses |
||
8 | """ |
||
9 | |||
10 | def recalculate(self): |
||
11 | """Recalculate the results |
||
12 | """ |
||
13 | title = self.context.Title() |
||
14 | calc = self.context.getCalculation() |
||
15 | if not calc: |
||
16 | return self.message("No calculation found", False, title=title) |
||
17 | success = self.context.calculateResult(override=True) |
||
18 | if not success: |
||
19 | return self.message( |
||
20 | "Failed to recalculate result", False, title=title) |
||
21 | |||
22 | return self.message("Result recalucated", True, title=title) |
||
23 |