Skip to content

Commit bedff11

Browse files
committed
Merge branch 'staging' into production
2 parents 2aa67b8 + 6d98c4a commit bedff11

File tree

6 files changed

+64
-20
lines changed

6 files changed

+64
-20
lines changed

bloomstack_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
__version__ = '2.0.10'
4+
__version__ = '2.0.11'

bloomstack_core/bloomstack_core/page/license_search/license_search.js

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,49 @@ class LicenseSearch {
253253
}
254254

255255
create_document(doctype, license) {
256-
frappe.show_alert({
257-
message: __("Saving License {0}", [license.license_number]),
258-
indicator: "blue"
259-
});
260-
frappe.xcall("bloomstack_core.bloomstack_core.page.license_search.license_search.add_license", {
261-
license: license
262-
}).then(r => {
263-
frappe.show_alert({
264-
message: __("Saved"),
265-
indicator: "green"
266-
});
256+
let me = this;
267257

268-
frappe.new_doc(doctype);
258+
let d = new frappe.ui.Dialog({
259+
title: __("Select Company"),
260+
fields: [
261+
{
262+
label: __("Company"),
263+
fieldtype: "Link",
264+
fieldname: "company",
265+
options: "Company",
266+
reqd: 1
267+
}
268+
],
269+
primary_action: function() {
270+
d.hide();
271+
let values = d.get_values();
272+
frappe.show_alert({
273+
message: __("Saving License {0}", [license.license_number]),
274+
indicator: "blue"
275+
});
276+
frappe.xcall("bloomstack_core.bloomstack_core.page.license_search.license_search.add_license", {
277+
license: license,
278+
company: values.company
279+
}).then(r => {
280+
frappe.show_alert({
281+
message: __("Saved"),
282+
indicator: "green"
283+
});
284+
285+
frappe.model.open_mapped_doc({
286+
method: "bloomstack_core.bloomstack_core.page.license_search.license_search.create_party_with_license",
287+
args: {
288+
party: doctype,
289+
license: {
290+
license: r
291+
}
292+
}
293+
});
294+
});
295+
}
269296
});
297+
298+
d.show();
270299
}
271300

272301
get_address(city, country, zip_code) {
@@ -343,4 +372,4 @@ class LicenseSearch {
343372
get_license_types() {
344373
return this.license_types;
345374
}
346-
}
375+
}

bloomstack_core/bloomstack_core/page/license_search/license_search.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def fetch_license_types_from_bloomtrace():
6969
return frappe.cache().hget("cannabis", "license_type")
7070

7171
@frappe.whitelist()
72-
def add_license(license):
72+
def add_license(license, company):
7373
license = json.loads(license)
7474

7575
existing_license = frappe.db.exists("Compliance Info", license.get("license_number"))
@@ -80,6 +80,7 @@ def add_license(license):
8080

8181
doc = frappe.get_doc({
8282
"doctype": "Compliance Info",
83+
"company": company,
8384
"license_number": license.get("license_number"),
8485
"license_type": license.get("license_type"),
8586
"license_category": license.get("license_category"),
@@ -92,3 +93,12 @@ def add_license(license):
9293
}).insert(ignore_permissions=True)
9394

9495
return doc.name
96+
97+
@frappe.whitelist()
98+
def create_party_with_license(source_name, target_doc=None):
99+
args = frappe.flags.args
100+
101+
party = frappe.new_doc(args.party)
102+
party.append("licenses", args.license)
103+
104+
return party

bloomstack_core/patches.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ bloomstack_core.patches.v0_0_1.set_task_name_in_timesheet
1313
bloomstack_core.patches.v0_0_1.move_compliance_item_to_item
1414
bloomstack_core.patches.v0_0_1.remove_bloomstack_user_integration
1515
bloomstack_core.patches.v0_0_1.delete_bom_from_property_setter
16-
bloomstack_core.patches.v0_0_1.removed_mandatory_for_attachment_field
16+
bloomstack_core.patches.v0_0_1.removed_mandatory_for_attachment_field #05-02-2021
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import frappe
22

33
def execute():
4-
frappe.delete_doc_if_exists("Custom Field", "Job Applicant-resume_attachment-reqd")
4+
frappe.delete_doc_if_exists("Custom Field", "Job Applicant-resume_attachment-reqd")
5+
frappe.delete_doc_if_exists("Property Setter", "Job Applicant-resume_attachment-reqd")

bloomstack_core/public/js/templates/address_list.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
</p>
1818
<p class="h6">
1919
{% if(addr_list[i].address_type!="Other") { %}
20-
<span class="text-muted">({%= __(addr_list[i].address_type) %})</span>{% } %}
20+
<span class="text-muted">Address Type: {%= __(addr_list[i].address_type) %}</span>{% } %}
21+
</p>
22+
<p class="h6">
2123
{% if(addr_list[i].is_primary_address) { %}
22-
<span class="text-muted">({%= __("Primary") %})</span>{% } %}
24+
<span class="text-muted">({%= __("Preferred Billing") %})</span>{% } %}
2325
{% if(addr_list[i].is_shipping_address) { %}
24-
<span class="text-muted">({%= __("Shipping") %})</span>{% } %}
26+
<span class="text-muted">({%= __("Preferred Shipping") %})</span>{% } %}
27+
{% if(addr_list[i].disabled) { %}
28+
<span class="text-muted">({%= __("Disabled") %})</span>{% } %}
2529
</p>
2630
<p>{%= addr_list[i].display %}</p>
2731
</div>

0 commit comments

Comments
 (0)