Dear Sangram,
many thanks for your response. I guess where I am stuck is here:
after_refresh: function() {
var me = this;
// show / hide new buttons (if allowed)
this.links_area.find('.btn-new').each(function() {
if(me.frm.can_create($(this).attr('data-doctype'))) {
$(this).removeClass('hidden');
}
});
},
My question is why is “can_create” not set? If I click the “Technical data sheet” link, it opens the list view of that DocType with the correct filter and I can add a related record (therefore I believe it cannot be an access right situation). But, the (+) sign does not show in the dashboard.
If I insert one of my DocTypes on the customer_dashboard.py it does show a plus sign to directly create a related record.
from frappe import _
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer',
'transactions': [
{
'label': _('Pre Sales'),
'items': ['Opportunity', 'Quotation', 'Crono']
},
{
'label': _('Orders'),
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
{
'label': _('Support'),
'items': ['Issue']
},
{
'label': _('Projects'),
'items': ['Project']
}
]
}
But this does not show the plus:
from frappe import _
def get_data():
return {
'fieldname': 'crono',
'transactions': [
{
'label': _('Information'),
'items': ['Technical data sheet', 'Sample identification']
},
{
'label': _('Tests'),
'items': ['Bunsen burner test', 'Ladder test', 'Smoke test', 'Accidity test']
},
{
'label': _('Reports'),
'items': ['Factory inspection', 'Classification', 'CoC']
}
]
}
Do I need to enable “can_create”? What am I missing?
Many thanks for any clue!