Auto generation of BPartner Location name

108 views
Skip to first unread message

Nicolas Micoud

unread,
Dec 8, 2017, 9:22:35 AM12/8/17
to iDempiere
Hi,

ATM, the C_BPartner_Location.Name field is updated when one of the location component (City, postal, Address1, ...) is updated.
A customer asks to add a checkbox on the C_BPartner_Location to preserve what he wrote in the name field.

The patch would be easy : modify the sql query which retrieves the C_BPartner_Location records

SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + m_location.getC_Location_ID()

to become :

SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + m_location.getC_Location_ID() + " AND IsAllowUpdate = 'Y'


Do you think this can be done in trunk ?

Regards,

Nicolas

Eduardo Gil

unread,
Dec 8, 2017, 1:49:52 PM12/8/17
to iDempiere
Hello every body. Is a good feature. Some of my customers also request to me this.

I have other comment about it. Why the location field is not converted in a quick entry instead of the the type of reference address is rigth now?

My argument if that 2 countries i work (panama, venezuela) needs other 2 subdivisions and i have to make plugins for this. If this can by a quick entry configuration is so easy and with the dicctionary to adap to any of this changes.

What do you think about this?

Carlos Antonio Ruiz Gomez

unread,
Dec 9, 2017, 8:47:18 AM12/9/17
to idem...@googlegroups.com
@Nicolas, is that rule for all addresses?  Or user just want to preserve the name of some addresses?
Wondering if instead of the flag would be worthy to add a Name2 to be freely filled by user.


@Eduardo
- I think if you go to dictionary and change the element type from Location to Table/TableDirect/Search - you can automatically use the quick entry, but I haven't tested
- that can be done in specific installations I guess, but replacing that in core doesn't sound good as the location window is capable of managing more stuff than the quick entry (f.e. order/display of fields)


Regards,

Carlos Ruiz
--

Nicolas Micoud

unread,
Dec 9, 2017, 9:34:43 AM12/9/17
to iDempiere
Hi Carlos,
Only for some addresses (sometimes City + Adr1 is not useful). That's why i thought adding a checkbox to preserve the name (written by user) from being updated automatically if the location is updated

I'm not sure the Name2 field could do the job, as we must be sure that it will alwayss be filled (as it could be used as an identifier). Means Name2 will be equals to Name in maybe 90% of cases (redondency...)

WDYT ?

Carlos Antonio Ruiz Gomez

unread,
Dec 9, 2017, 9:52:39 AM12/9/17
to idem...@googlegroups.com
Nicolas, when you say

> sometimes City + Adr1 is not useful
I wonder if you're aware about the SysConfig START_VALUE_BPLOCATION_NAME

Nicolas Micoud

unread,
Dec 9, 2017, 2:46:33 PM12/9/17
to iDempiere
Yes, i know that and I'm using it :)

Carlos Antonio Ruiz Gomez

unread,
Dec 10, 2017, 5:20:14 AM12/10/17
to idem...@googlegroups.com
Hi Nicolas, in such case I think your idea makes sense - but I would suggest to name the flag with something like "Preserve custom name"

Regards,

Carlos Ruiz

Nicolas Micoud

unread,
Dec 11, 2017, 2:46:41 AM12/11/17
to iDempiere
Reply all
Reply to author
Forward
0 new messages