Skip to content

Commit

Permalink
Merge branch 'hotfix/3.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfruit committed Jul 17, 2014
2 parents 6d84d92 + 34eacf0 commit a1900ea
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 119 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
3.1.3 (2014-07-17)
------------------

Missing fixes from 3.1.2

LIMS-671: Preferred/Restricted client categories
LIMS-1251: Supply order permission error
LIMS-1272: Currency in Price Lists
LIMS-1310: Broken AnalysisProfile selector in AR Add form.

3.1.2 (2014-07-15)
------------------

Expand Down
6 changes: 5 additions & 1 deletion bika/lims/browser/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,11 @@ def folderitems(self):

# Sets the analyst assigned to this analysis
if can_edit_analysis:
items[i]['Analyst'] = obj.getAnalyst()
analyst = obj.getAnalyst()
# widget default: current user
if not analyst:
analyst = mtool.getAuthenticatedMember().getUserName()
items[i]['Analyst'] = analyst
item['choices']['Analyst'] = self.getAnalysts()
else:
items[i]['Analyst'] = obj.getAnalystName()
Expand Down
2 changes: 1 addition & 1 deletion bika/lims/browser/analysisrequest/templates/ar_add.pt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
tal:attributes="EnableARSpecs python: 'true' if bika_setup.getEnableARSpecs() else '';
bika_samplepoints_uid python: bika_setup.bika_samplepoints.UID();
bika_artemplates_uid python: bika_setup.bika_artemplates.UID();
bika_analysisprofiles_uid python: bika_setup.bika_analysisspecs.UID();
bika_analysisprofiles_uid python: bika_setup.bika_analysisprofiles.UID();
bika_analysisspecs_uid python: bika_setup.bika_analysisspecs.UID();
bika_analysisspecs_path python:'/'.join(bika_setup.bika_analysisspecs.getPhysicalPath())">
</span>
Expand Down
5 changes: 5 additions & 0 deletions bika/lims/browser/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from bika.lims.interfaces import IInvoiceView
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.i18n.locales import locales
from zope.interface import implements


Expand Down Expand Up @@ -38,6 +39,10 @@ def __call__(self):
self.clientFax = client.getFax()
self.clientEmail = client.getEmailAddress()
self.clientAccountNumber = client.getAccountNumber()
# currency info
locale = locales.getLocale('en')
self.currency = self.context.bika_setup.getCurrency()
self.symbol = locale.numbers.currencies[self.currency].symbol
# Get an available client address in a preferred order
self.clientAddress = None
addresses = (
Expand Down
6 changes: 6 additions & 0 deletions bika/lims/browser/js/ar_add.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,10 @@ function fill_column(data) {
}
}

function expand_default_categories() {
$("th.prefill").click();
}

$(document).ready(function() {

// Only if the view is the Analysis Request Add View
Expand All @@ -1361,6 +1365,7 @@ $(document).ready(function() {
// dateFormat = 'yy-mm-dd';
// }


ar_rename_elements();
ar_referencewidget_lookups();
ar_set_tabindexes();
Expand All @@ -1370,6 +1375,7 @@ $(document).ready(function() {
$(".copyButton").live("click", copyButton );

$("th[class^='analysiscategory']").click(clickAnalysisCategory);
expand_default_categories();

$("input[name^='Price']").live("change", recalc_prices );

Expand Down
12 changes: 6 additions & 6 deletions bika/lims/browser/templates/invoice_content.pt
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
<td class="text" tal:content="item/description"></td>
<td tal:content="item/orderNo"></td>
<td>
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="item/subtotal">0.00</span>
</td>
<td>
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="item/VATAmount">0.00</span>
</td>
<td>
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="item/total">0.00</span>
</td>
</tr>
Expand All @@ -82,15 +82,15 @@
<tr class="totals">
<td colspan="3" i18n:translate="">Total</td>
<td class="currency">
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="view/subtotal"></span>
</td>
<td class="currency">
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="view/VATAmount"></span>
</td>
<td class="currency">
<span i18n:translate="label_currency_abbreviation">R</span>
<span tal:content="view/currency">R</span>
<span tal:content="view/total"></span>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions bika/lims/profiles/default/structure/front-page
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
id: front-page
title: Welcome to Gaob Bika LIMS 3
description: This is version 3.1.2
description: This is version 3.1.3
subject:
relatedItems:
location:
language:
effectiveDate: 2011/01/01
expirationDate: None
creation_date: 2011/01/01
modification_date: 2014/07/14
modification_date: 2014/07/17
creators: admin
contributors:
rights:
Expand Down
3 changes: 1 addition & 2 deletions bika/lims/tests/test_Client.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resource plone/app/robotframework/saucelabs.robot
Variables plone/app/testing/interfaces.py
Variables bika/lims/tests/variables.py
Suite Setup Start browser
#Suite Teardown Close All Browsers
Suite Teardown Close All Browsers

*** Variables ***

Expand Down Expand Up @@ -130,7 +130,6 @@ Client contact should not be able to see or access other clients
Go to ${PLONEURL}/clients/client-2
Page should contain Insufficient Privileges


*** Keywords ***

Start browser
Expand Down
110 changes: 9 additions & 101 deletions bika/lims/tests/test_OptionalAttributes.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Create AR with hidden attributes

*** Keywords ***

Start browser
Open browser ${PLONEURL}/login_form
Set selenium speed ${SELENIUM_SPEED}

Hide Attributes
Log in admin secret
Wait until page contains You are now logged in
Expand All @@ -40,10 +44,6 @@ Hide Attributes
Click Button Save
Log out

Start browser
Open browser ${PLONEURL}/login_form
Set selenium speed ${SELENIUM_SPEED}

Check hidden fields on AR Add
Log in test_labmanager test_labmanager
Go to ${PLONEURL}/clients/client-1
Expand All @@ -66,9 +66,13 @@ Create Primary AR
Wait until page contains element css=body.portaltype-client
Click Link Add
Wait until page contains Request new analyses
sleep 1
Select Date ar_0_SamplingDate @{time}[2]
sleep 1
Select from dropdown ar_0_Contact Rita
sleep 1
Select from dropdown ar_0_Template Bore
Select Date ar_0_SamplingDate @{time}[2]
sleep 1
Set Selenium Timeout 30
Click Button Save
Set Selenium Timeout 10
Expand Down Expand Up @@ -96,104 +100,8 @@ Check hidden fields on AR invoice ${ar_id}
Page should not contain Invoice Exclude

Check hidden fields on Sample view
http://localhost:55001/plone/clients/client-1/H2O-0001
Go to http://localhost:55001/plone/clients/client-1/H2O-0001
Page should not contain Sample Point
Page should not contain Sampling Deviation
Page should not contain Client SID
Page should not contain Ad-Hoc

Receive sample
Select checkbox xpath=//input[@item_title="${ar_id}"]
Click button xpath=//input[@value="Receive sample"]
Wait until page contains saved


Complete ar_add form Without template
@{time} = Get Time year month day hour min sec
SelectDate ar_0_SamplingDate @{time}[2]
Select From Dropdown ar_0_SampleType Water
Select from dropdown ar_0_Contact Rita
Select from dropdown ar_0_Priority High
Click Element xpath=//th[@id='cat_lab_Water Chemistry']
Select Checkbox xpath=//input[@title='Moisture' and @name='ar.0.Analyses:list:ignore_empty:record']
Click Element xpath=//th[@id='cat_lab_Metals']
Select Checkbox xpath=//input[@title='Calcium' and @name='ar.0.Analyses:list:ignore_empty:record']
Select Checkbox xpath=//input[@title='Phosphorus' and @name='ar.0.Analyses:list:ignore_empty:record']
Click Element xpath=//th[@id='cat_lab_Microbiology']
Select Checkbox xpath=//input[@title='Clostridia' and @name='ar.0.Analyses:list:ignore_empty:record']
Select Checkbox xpath=//input[@title='Ecoli' and @name='ar.0.Analyses:list:ignore_empty:record']
Select Checkbox xpath=//input[@title='Enterococcus' and @name='ar.0.Analyses:list:ignore_empty:record']
Select Checkbox xpath=//input[@title='Salmonella' and @name='ar.0.Analyses:list:ignore_empty:record']
Set Selenium Timeout 60
Click Button Save
Wait until page contains created
${ar_id} = Get text //dl[contains(@class, 'portalMessage')][2]/dd
${ar_id} = Set Variable ${ar_id.split()[2]}
[return] ${ar_id}

Submit results with out of range tests
[Documentation] Complete all received analysis result entry fields
... Do some out-of-range checking, too
${count} = Get Matching XPath Count //input[@type='text' and @field='Result']
${count} = Convert to integer ${count}
:FOR ${index} IN RANGE 1 ${count+1}
\ TestResultsRange xpath=(//input[@type='text' and @field='Result'])[${index}] 5 10
Sleep 10s
Click Element xpath=//input[@value='Submit for verification'][1]
Wait Until Page Contains Changes saved.

Submit results
[Documentation] Complete all received analysis result entry fields
${count} = Get Matching XPath Count //input[@type='text' and @field='Result']
${count} = Convert to integer ${count}
:FOR ${index} IN RANGE 1 ${count+1}
\ Input text xpath=(//input[@type='text' and @field='Result'])[${index}] 10
Sleep 10s
Click Element xpath=//input[@value='Submit for verification'][1]
Wait Until Page Contains Changes saved.

Add new ${service} analysis to ${ar_id}
Go to ${PLONEURL}/clients/client-1/${ar_id}/analyses
select checkbox xpath=//input[@alt='Select ${service}']
click element save_analyses_button_transition
wait until page contains saved.

${ar_id} state should be ${state_id}
Go to ${PLONEURL}/clients/client-1/${ar_id}
log span.state-${state_id} warn
Page should contain element css=span.state-${state_id}

TestResultsRange
[Arguments] ${locator}=
... ${badResult}=
... ${goodResult}=

# Log Testing Result Range for ${locator} -:- values: ${badResult} and ${goodResult} WARN

Input Text ${locator} ${badResult}
Press Key ${locator} \\9
Expect exclamation
Input Text ${locator} ${goodResult}
Press Key ${locator} \\9
Expect no exclamation

Expect exclamation
sleep .5
Page should contain Image ${PLONEURL}/++resource++bika.lims.images/exclamation.png

Expect no exclamation
sleep .5
Page should not contain Image ${PLONEURL}/++resource++bika.lims.images/exclamation.png

TestSampleState
[Arguments] ${locator}=
... ${sample}=
... ${expectedState}=

${VALUE} Get Value ${locator}
Should Be Equal ${VALUE} ${expectedState} ${sample} Workflow States incorrect: Expected: ${expectedState} -
# Log Testing Sample State for ${sample}: ${expectedState} -:- ${VALUE} WARN

5 changes: 0 additions & 5 deletions bika/lims/tests/test_bika_setup.robot
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ Repetitive Bika Setup stuff
Click link Accreditation
Input Text Confidence 95
Select Checkbox LaboratoryAccredited
Input Text AccreditationBodyLong Accreditation Body Name
Input Text AccreditationBody ABBREVIATION
Input Text AccreditationBodyURL http://www.body.com
Input Text Accreditation Accreditation Type
Input Text AccreditationReference Reference
Click Button Save
Wait Until Page Contains Changes saved.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = '3.1.2'
version = '3.1.3'

setup(name='bika.lims',
version=version,
Expand Down

0 comments on commit a1900ea

Please sign in to comment.