Discussion:
[Erp5-dev] Address for site/ category
Łukasz Nowak
2007-04-04 10:25:43 UTC
Permalink
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.

I was thinking about such scenarios:
(a) for an organisation add Address (and phone, email, fax) objects
with id same as site id
(b) add site category for Address (and phone, email, fax) object and
relate them with proper category.

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 :)

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)
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
Jean-Paul Smets
2007-04-04 11:12:37 UTC
Permalink
Post by Łukasz Nowak
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.
Post by Łukasz Nowak
(a) for an organisation add Address (and phone, email, fax) objects
with id same as site id
Not good, not bad.
Post by Łukasz Nowak
(b) add site category for Address (and phone, email, fax) object and
relate them with proper category.
Bad.
Post by Łukasz Nowak
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.
Post by Łukasz Nowak
Thanks,
Luke
Organisation: ACME
Site: site/acme_site
default_address DA
warA_address WA-A (site/acme_site/warehouseA)
warA_address WA-C (site/acme_site/warehouseC)
site/acme_site
site/acme_site/warehouseA
site/acme_site/warehouseB
site/acme_site/warehouseC
site/acme_site/warehouseC/buildingA
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
Loading...