Merge pull request #12642 from mntechnique/fix-to-issue-#12512
Fix to issue #12512
This commit is contained in:
commit
fc318ebeff
@ -86,6 +86,7 @@ erpnext.stock.ItemDashboard = Class.extend({
|
||||
get_item_dashboard_data: function(data, max_count, show_item) {
|
||||
if(!max_count) max_count = 0;
|
||||
if(!data) data = [];
|
||||
|
||||
data.forEach(function(d) {
|
||||
d.actual_or_pending = d.projected_qty + d.reserved_qty + d.reserved_qty_for_production;
|
||||
d.pending_qty = 0;
|
||||
@ -97,9 +98,16 @@ erpnext.stock.ItemDashboard = Class.extend({
|
||||
max_count = Math.max(d.actual_or_pending, d.actual_qty,
|
||||
d.total_reserved, max_count);
|
||||
});
|
||||
|
||||
var can_write = 0;
|
||||
if(frappe.boot.user.can_write.indexOf("Stock Entry")>=0){
|
||||
can_write = 1;
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
max_count: max_count,
|
||||
can_write:can_write,
|
||||
show_item: show_item || false
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
{% if can_write %}
|
||||
<div class="col-sm-2 text-right" style="margin-top: 8px;">
|
||||
{% if d.actual_qty %}
|
||||
<button class="btn btn-default btn-xs btn-move"
|
||||
@ -52,6 +53,7 @@
|
||||
data-item="{{ d.item_code }}"
|
||||
data-rate="{{ d.valuation_rate }}">{{ __("Add") }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user