Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flushing CCEmail fields in Sample Add Form #1540

Merged
merged 3 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Changelog

**Fixed**

- #1540 Fix flushing CCEmail fields in Sample Add Form
- #1533 Fix traceback from log when rendering stickers preview
- #1525 Fix error when creating partitions with analyst user
- #1522 Fix sporadical timeout issue when adding new samples/remarks
Expand Down
2 changes: 1 addition & 1 deletion bika/lims/browser/analysisrequest/add2.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def get_client_info(self, obj):

# Set default CC Email field
info["field_values"].update({
"CCEmails": {"value": obj.getCCEmails()}
"CCEmails": {"value": obj.getCCEmails(), "if_empty": True}
})

# UID of the client
Expand Down
2 changes: 1 addition & 1 deletion bika/lims/browser/js/bika.lims.analysisrequest.add.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
values_json = $.toJSON(values);
field = $("#" + field_name + ("-" + arnum));
if ((values.if_empty != null) && values.if_empty === true) {
if (!field.val()) {
if (field.val()) {
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class window.AnalysisRequestAdd

if values.if_empty? and values.if_empty is true
# Set the value if the field is empty only
if not field.val()
if field.val()
return

console.debug "apply_dependent_value: field_name=#{field_name} field_values=#{values_json}"
Expand Down