Ordering of the fields

68 views
Skip to first unread message

MP

unread,
Apr 29, 2013, 9:32:40 AM4/29/13
to erpnext-dev...@googlegroups.com
Hi,

We have a need to re-order the fields the way they appear for Item and other doctypes from Buying module. As I understand the current customise Form functionality doesn't allow re-ordering of the fields. I am able to re-order the fields the way we want by manipulating database table. My question is, is this okay to re-order fields at database level? Will it affect any of the functionality? Will I lose this ordering if I updated my ERPNext using ./wnf.py --update origin master command?

Kind regards,
Mayur Patel

Anand Doshi

unread,
Apr 29, 2013, 10:13:40 AM4/29/13
to erpnext-dev...@googlegroups.com
Hi Mayur,

You will lose your positional changes when you update ERPNext.

This feature was available previously in customise form, but users used to mess up the form layout by changing the field positions.

But there is a way. There is a trick to changing field positions.

Create a Property Setter with the following values for each field position change:

DocType or Field = "DocField"
DocType = DESIRED_DOCTYPE
Field Name = DESIRED_FIELDNAME
Property = "previous_field"
Property Type = "Data"
Set Value = PREVIOUS_FIELDNAME_TO_THIS_FIELD

Save. Clear Cache & Refresh and then check.

Thanks,
Anand.


--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/DLAqIEvO-N4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Aditya Duggal

unread,
Apr 29, 2013, 10:13:15 AM4/29/13
to erpnext-dev...@googlegroups.com
Dear Mayur,

As far as I know that this direct change in the doctype would be removed as soon as there is any update in that particular DOCTYPE and that you can never know before updating.

So your field arrangement is good for updates till there is not update in the buying module or to be more precise in the doctype. I hope this answers your question and I also hope that I am right.



--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/DLAqIEvO-N4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



-- 

Mahesh

unread,
Apr 29, 2013, 10:21:50 AM4/29/13
to erpnext-dev...@googlegroups.com
is this applicable for SAAS users too ?

Anand Doshi

unread,
Apr 29, 2013, 10:26:56 AM4/29/13
to erpnext-dev...@googlegroups.com
Yes. But if done wrong, It will completely mess up the form field arrangements. 

If we remove a field from the product or move it, it causes a cascaded shifting of fields. 

Hence such a thing is made easy only for custom fields. 

If you have any suggestions regarding field positions, we can try to put it in the product provided they are generic enough. 

Sent from my phone

Rushabh Mehta

unread,
Apr 30, 2013, 12:37:35 AM4/30/13
to erpnext-dev...@googlegroups.com
We strongly recommend moving fields around, at times fields are shown / hidden sequentially based on the "previous" field logic. Also we may push a new (better) ordering in future - so it will mess up any re-organization).

If you have a better suggestion for field ordering please let us know.


W: https://erpnext.com
T: @rushabh_mehta

On 29-Apr-2013, at 7:51 PM, Mahesh <ma...@maheshengg.com> wrote:

Aditya Duggal

unread,
Apr 30, 2013, 1:22:51 AM4/30/13
to erpnext-dev...@googlegroups.com
Hi Developers,

I guess the way the rearrangement is done in the erpnext is OK but I guess the logic in the code is somewhat not correct and hence the problem of messed up ordering happens in case of an update or something.

I would request you people to let us know which part of the code handles the re-ordering of fields so that we could all understand the logic behind it and hopefully come up with a better solution, since currently the logic being used is something which needs improvement.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/DLAqIEvO-N4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

MP

unread,
Apr 30, 2013, 3:34:09 AM4/30/13
to erpnext-dev...@googlegroups.com
Hi Anand,

How do I create a property setter? I haven't done this before. Thanks.


Kind regards,
Mayur Patel

Nabin Hait

unread,
Apr 30, 2013, 5:15:44 AM4/30/13
to erpnext-dev...@googlegroups.com
Hi Mayur,

Add the following in the url after #:
Form/Property Setter/New Property Setter

- Nabin Hait

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.

Nabin Hait

unread,
Apr 30, 2013, 5:17:16 AM4/30/13
to erpnext-dev...@googlegroups.com
You can also create from Toolbar --> New --> Property Setter

On 30-Apr-2013, at 1:04 PM, MP wrote:

Anand Doshi

unread,
May 1, 2013, 1:33:12 AM5/1/13
to erpnext-dev...@googlegroups.com
You can have a look at how a doctype is loaded for the client side. Check webnotes/model/doctype.py get method.

You will need some proficiency in python to be able to understand this. For any help on python, you can have a look at http://docs.python.org/release/2.7/

Thanks,
Anand.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages