Different views for same Doctype

How can i define two different views for doctype ?

My customer has in his old system the ability to view his customer in 2 different views and i must reimplement this in erpnext…

let me explain in different words:

View 1 => only has the fields where relevant for case 1
View 2 => only has other fields where relevant for case 2

I hope this is understandable…

kind regards

hi:

Try Doctype Layout tool. Search this on awesome bar …
I think this feature is unfinished but seems it’s working.

Hope this helps.

Could a duplicate of the doctype be created , eliminating the unnecessary fields?

you mean this one

/app/doctype-layout/ ???

hmmmm… no its the Item Doctype ( more than 400000 items in there )…

i need all items in the same table :slight_smile:

Hi, if your ‘case1’ & ‘case2’ are based on different User Roles, you could try to use Permission Levels on the relevant fields you want to show or hide.
For example, for fields that both ‘cases’ want to see then leave the PermLevel at 0 (default), but if only ‘case1’ needs to see a field then set it as PermLevel1 and then in your Role Permissions make sure you add the relevant entries for it

so maybe you can describe what differentiates case one from case two?

ok… i try to explain what my customer needs… :smiley:

the same userrole needs for example two views for item doctype… the item doctype has 65 fields… 21 fields is for sale and 40 fields are used for goods incomming to stock… and other fields and mixtures of sales and incomming fiels for ecommerce purpose

and a mix of these fields i must use in reporting one time for stock overviews and one time for callback

i hope i can a bit more explain about my customers case…

ok… now i have a second requirement for this question…

my customer have a tablet where his endcustomer must signature the salesorder… thats done by the signature field… so on no problem…

but my customer writes spezial informations in this salesorder who his endcustomer does not may see ( priceinformations and so on like descriptions about the supplier prices )

so… my idea is … on form for creating and updating the sales order… and another form only for customer signatures ( without the special fields for internal purpose )

You can use field level permission and control which fields should be visible for which role.
Customize the doctype field and assign number greater than one say 2


Then create a custom role and in the role permission manager create a permission with level 2

Now whichever field permission level 2 is assigned only those field can be viewed by that role

hmmm… thats sound ok …

for claryfication on this point…

My customer sitting on a table with his customer… and then she discuss there requirements and whats to sale … after that meeting on the same table my customer ( used a Tablet ) getting this to his endcustomer to signature this sales order…

every order is a endcustomer specific placement and will produced exclusive for this customer …

maybe on the order will be some items like :
titanium : 1 kg 100.- (inboundprice 45.-)
aluminium : 0.3kg 30.- (inboundprice 18.-)
workhours : 10 120.- ( shelfprice 85.-)
external service 2 200.- ( internal calc 95.-)
total : xyz bliblablu

for the customer to signature :
titanium : 1 kg 100.-
aluminium : 0.3kg 30.-
workhours : 10 120.-
external service 2 200.-
total : xyz bliblablu

so … my customer cant switch the role because of his customer sit on the same table and discuss the order…

he works with a ERP at this moment who can define 1 … n views for the same doctype and he switching the view to a name called “endkunden unterschrift” and all not relevant data disappear…

@Eto I have read this post of yours and I have thought about an easy way to implement such thing but there wasn’t any…

After a lot of thinking, I came up with an idea that enables having multiple views for each doctype in both list view and form…

But I’ve been struggling in finding an easy way to link any doctype with its child tables since child tables can be used in multiple doctypes…

I have already started working on a plugin for that but I’m still wondering how useful will such modification be for others…

Just wanted to share this with you for now…

Best regards…

2 Likes