[Erp5-dev] Address for site/ category

Jean-Paul Smets jp at nexedi.com
Wed Apr 4 13:12:37 CEST 2007


Le mercredi 4 avril 2007 12:25, Łukasz Nowak a écrit :
> Hello,
>
> I'm preparing to implement categories for source/destination on
> Sale/Purchase and other product related movement documents.
>
> Is there implementation for getting address for site/ category in ERP5?
> Or shall I implement something specific? Address would be used only for
> printed documents and UI representation.


There is something called "mapping".

By setting the mapping relation between an organisation and a category, you 
define that organisation as the representative of the category. This way, 
the category address is the one of the organisation.

organisation_x.getMappingValue(category_x)

BTW, organisations are also related to some categories (ex. group). So, this 
is only useful for categories which organisation are not member of 
directly.


> I was thinking about such scenarios:
>   (a) for an organisation add Address (and phone, email, fax) objects
> with id same as site id

Not good, not bad.

>   (b) add site category for Address (and phone, email, fax) object and
> relate them with proper category.

Bad.

> In (a) there is need for some magic, eg. to find Address for
> subwarehouse which is subcategory of site, and I *feel* its not well
> suited.
>
> In (b) relation between address (and rest) with site is simple. Only
> little magic is needed to find address for category, which parents do
> have address.
>
> Well - I hope that I was clear enough. I'd like to implement such
> feature in Nexedi-acceptable way and may put it into core?
>
> If something like this is implemented already let me know :)

What is not implemented in public SVN is automatic accessors. It would be 
good idea to extend for example the coordinates / address accessors in such 
way that 
	- organisation without address gets it from the site or group
	- category gets address either from related mapping organisation or from 
parent category

This would required to extend a bit the current accessors. I think someone 
already did this but it was not committed. Maybe time to do it...

JPS.


> Thanks,
> Luke
>
> Example config for (b):
>
> Organisation: ACME
>    Site: site/acme_site
>    Addresses:
>      default_address DA
>      warA_address WA-A (site/acme_site/warehouseA)
>      warA_address WA-C (site/acme_site/warehouseC)
>
> Sites:
>    site/acme_site
>    site/acme_site/warehouseA
>    site/acme_site/warehouseB
>    site/acme_site/warehouseC
>    site/acme_site/warehouseC/buildingA
>
> for site in Sites:
>    site,site.getAddress():
>      site/acme_site,DA (cos we are site for Organisation:ACME)
>      site/acme_site/warehouseA,WA-A (direct)
>      site/acme_site/warehouseB,DA (by parent)
>      site/acme_site/warehouseC,WC-C (direct)
>      site/acme_site/warehouseC/buildingA,WC-C (by parent)

-- 
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Rentalinux: Desktop Linux Server
http://www.rentalinux.com



More information about the Erp5-dev mailing list