Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav Naik committed Mar 29, 2017
2 parents dc80e69 + 87b9f95 commit 1adcddc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 29 deletions.
2 changes: 1 addition & 1 deletion awfis_erpnext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import unicode_literals

__version__ = '1.7.24'
__version__ = '1.7.25'
7 changes: 5 additions & 2 deletions awfis_erpnext/awfis_erpnext/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_lead_list_data():
)
user_territories = [ut.defvalue for ut in user_territories]

if "Sales Manager" in user_roles or "Awfis Ops Manager" in user_roles:
if "Sales Manager" in user_roles or "Awfis Ops Manager" in user_roles or "System Manager" in user_roles:
team = frappe.get_all("DefaultValue",
fields=["parent"],
filters=[["defkey", "=", "Territory"],["defvalue", "in", user_territories], ["parenttype", "=", "User Permission"]],
Expand All @@ -63,7 +63,10 @@ def get_lead_list_data():
(l.contact_date and frappe.utils.getdate(l.contact_date) == frappe.utils.getdate()) and
(
(l.owner in team) or
(l._assign and len([assignee for assignee in ast.literal_eval(l._assign) if assignee in team]) > 0)
(l._assign and
(len([assignee for assignee in ast.literal_eval(l._assign) if assignee in team]) > 0) or
(frappe.session.user in ast.literal_eval(l._assign))
)
)
]

Expand Down
66 changes: 40 additions & 26 deletions awfis_erpnext/public/js/awfis_lead_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="row">
<div class="col-sm-9 list-col ellipsis col-xs-12">
<div class="row">
<div class="col-sm-6 ellipsis" title="{%= data_grid_1[i].lead_name %}, {%= data_grid_1[i].lead_name %}">
<div class="col-sm-6 ellipsis" title="{%= data_grid_1[i].lead_name %}, {%= data_grid_1[i].awfis_lead_territory %}">
<a class="bold" href="/desk#Form/Lead/{{ data_grid_1[i].name }}">{%= data_grid_1[i].lead_name %}</a>
<span class="small text-muted ellipsis">{%= data_grid_1[i].awfis_lead_territory %}</span>
</div>
Expand All @@ -48,13 +48,17 @@
</div>
</div>
<div class="col-sm-3 list-col ellipsis col-xs-12">
<span class="text-muted" title="{%= data_grid_1[i].creation %}">
{% var pd = prettyDate(data_grid_1[i].creation, 1); %}
{%= pd %}
</span>
<span class="text-muted">

</span>
<ul class="list-inline text-right" title="{%= data_grid_1[i].creation %}">
<li>{% var pd = prettyDate(data_grid_1[i].creation, 1); %}{%= pd %}</li>
<li>
{% var assign_list1 = JSON.parse(data_grid_1[i]._assign) || []; %}
{% if (assign_list1.length) { %}
{%= frappe.avatar(assign_list1[assign_list1.length - 1]) %}
{% } else { %}
<span class="avatar avatar-small avatar-empty"></span>
{% } %}
</li>
</ul>
</div>
</div>
</div>
Expand Down Expand Up @@ -106,22 +110,28 @@
<div class="row">
<div class="col-sm-9 list-col ellipsis col-xs-12">
<div class="row">
<div class="col-sm-6 ellipsis" title="{%= data_grid_2[i].lead_name %}, {%= data_grid_2[i].territory %}">
<div class="col-sm-6 ellipsis" title="{%= data_grid_2[i].lead_name %}, {%= data_grid_2[i].awfis_lead_territory %}">
<a class="bold" href="/desk#Form/Lead/{{ data_grid_2[i].name }}">{%= data_grid_2[i].lead_name %}</a>
<span class="small text-muted ellipsis">{%= data_grid_2[i].territory %}</span>
<span class="small text-muted ellipsis">{%= data_grid_2[i].awfis_lead_territory %}</span>
</div>
<div class="col-sm-4"><span class="small">{%= data_grid_2[i].mobile_no %}</span></div>
<div class="col-sm-2"><span class="small">{%= data_grid_2[i].status %}</span></div>
</div>
</div>
<div class="col-sm-3 list-col ellipsis col-xs-12">
<span class="text-muted" title="{%= data_grid_2[i].creation %}">
{% var pd = prettyDate(data_grid_2[i].creation, 1); %}
{%= pd %}
</span>
<span class="text-muted">

</span>
<ul class="list-inline text-right">
<li title="{%= data_grid_2[i].creation %}">
{% var pd = prettyDate(data_grid_2[i].creation, 1); %}{%= pd %}
</li>
<li>
{% var assign_list2 = JSON.parse(data_grid_2[i]._assign) || []; %}
{% if (assign_list2.length) { %}
{%= frappe.avatar(assign_list2[assign_list2.length - 1]) %}
{% } else { %}
<span class="avatar avatar-small avatar-empty"></span>
{% } %}
</li>
</ul>
</div>
</div>
</div>
Expand Down Expand Up @@ -179,24 +189,28 @@
<div class="row">
<div class="col-sm-9 list-col ellipsis col-xs-12">
<div class="row">
<div class="col-sm-6 ellipsis" title="{%= data_grid_3[i].lead_name %}, {%= data_grid_3[i].territory %}">
<div class="col-sm-6 ellipsis" title="{%= data_grid_3[i].lead_name %}, {%= data_grid_3[i].awfis_lead_territory %}">
<a class="bold" href="/desk#Form/Lead/{{ data_grid_3[i].name }}">
{%= data_grid_3[i].lead_name %}
</a>
<span class="small text-muted ellipsis">{%= data_grid_3[i].lead_awfis_territory %}</span>
<span class="small text-muted ellipsis">{%= data_grid_3[i].awfis_lead_territory %}</span>
</div>
<div class="col-sm-4"><span class="small">{%= data_grid_3[i].mobile_no %}</span></div>
<div class="col-sm-2"><span class="small">{%= data_grid_3[i].status %}</span></div>
</div>
</div>
<div class="col-sm-3 list-col ellipsis col-xs-12">
<span class="text-muted" title="{%= data_grid_3[i].creation %}">
{% var pd = prettyDate(data_grid_3[i].creation, 1); %}
{%= pd %}
</span>
<span class="text-muted">

</span>
<ul class="list-inline text-right">
<li>{% var pd = prettyDate(data_grid_3[i].creation, 1); %} {%= pd %}</li>
<li title="{%= data_grid_3[i].creation %}">
{% var assign_list3 = JSON.parse(data_grid_3[i]._assign) || []; %}
{% if (assign_list3.length) { %}
{%= frappe.avatar(assign_list3[assign_list3.length - 1]) %}
{% } else { %}
<span class="avatar avatar-small avatar-empty"></span>
{% } %}
</li>
</ul>
</div>
</div>
</div>
Expand Down

0 comments on commit 1adcddc

Please sign in to comment.