mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims: trend chart: allow to use sample number as X-axis
This commit is contained in:
parent
d7808e7c43
commit
6234f020e8
2 changed files with 10 additions and 0 deletions
|
@ -1437,6 +1437,7 @@ class TrendChart(ModelSQL, ModelView):
|
||||||
], 'Precedents Filter', sort=False, required=True)
|
], 'Precedents Filter', sort=False, required=True)
|
||||||
x_axis = fields.Selection([
|
x_axis = fields.Selection([
|
||||||
('date', 'Date'),
|
('date', 'Date'),
|
||||||
|
('number', 'Sample'),
|
||||||
], 'X Axis', sort=False, required=True)
|
], 'X Axis', sort=False, required=True)
|
||||||
x_axis_string = x_axis.translated('x_axis')
|
x_axis_string = x_axis.translated('x_axis')
|
||||||
active = fields.Boolean('Active', help='Check to include in future use')
|
active = fields.Boolean('Active', help='Check to include in future use')
|
||||||
|
@ -1868,12 +1869,17 @@ class OpenTrendChart(Wizard):
|
||||||
|
|
||||||
if chart.x_axis == 'date':
|
if chart.x_axis == 'date':
|
||||||
clause.append(('date', '<=', notebook.date))
|
clause.append(('date', '<=', notebook.date))
|
||||||
|
elif chart.x_axis == 'number':
|
||||||
|
clause.append(('fraction.sample.number', '<=',
|
||||||
|
notebook.fraction.sample.number))
|
||||||
return clause
|
return clause
|
||||||
|
|
||||||
def _get_order(self):
|
def _get_order(self):
|
||||||
chart = self.start.chart
|
chart = self.start.chart
|
||||||
if chart.x_axis == 'date':
|
if chart.x_axis == 'date':
|
||||||
return [('date', 'DESC')]
|
return [('date', 'DESC')]
|
||||||
|
elif chart.x_axis == 'number':
|
||||||
|
return [('fraction.sample.number', 'DESC')]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _get_reportable_analysis(self):
|
def _get_reportable_analysis(self):
|
||||||
|
|
|
@ -13341,6 +13341,10 @@ msgctxt "selection:lims.trend.chart,x_axis:"
|
||||||
msgid "Date"
|
msgid "Date"
|
||||||
msgstr "Fecha"
|
msgstr "Fecha"
|
||||||
|
|
||||||
|
msgctxt "selection:lims.trend.chart,x_axis:"
|
||||||
|
msgid "Sample"
|
||||||
|
msgstr "Muestra"
|
||||||
|
|
||||||
msgctxt "selection:lims.typification,report_result_type:"
|
msgctxt "selection:lims.typification,report_result_type:"
|
||||||
msgid "Both"
|
msgid "Both"
|
||||||
msgstr "Ambos"
|
msgstr "Ambos"
|
||||||
|
|
Loading…
Reference in a new issue