Discussion:
[Erp5-dev] PropertExistence Constraint and acquired properties
Łukasz Nowak
2008-09-15 08:26:12 UTC
Permalink
Hello,

I'm using PropertyExistence Constraint for Organisation portal type to
check is address is defined.

Well - this class is not working for "virtual" properties using
storage_id, as test object.hasProperty('default_address_city') returns
0, even if object.getProperty('default_address_city') returns proper
value.

Of course I'll create my own Constraint class for such properties, but
I'd like to know what is your opinion in this case. Shall it be another
Constraint or shall PropertyExistence support such situation? (Or maybe
there is Constraint class for this case which I missed?)

Regards,
Luke
--
?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...'' I am only craftsman.
Yoshinori Okuji
2008-09-19 07:23:57 UTC
Permalink
Post by Łukasz Nowak
Hello,
I'm using PropertyExistence Constraint for Organisation portal type to
check is address is defined.
Well - this class is not working for "virtual" properties using
storage_id, as test object.hasProperty('default_address_city') returns
0, even if object.getProperty('default_address_city') returns proper
value.
This should be considered to be a bug. As you can see in Utils, ERP5 generates
testers, but perhaps the code does not cover all cases. Please check if
hasDefaultAddressCity is generated. My guess is that acquired_property_id is
not taken into account when generating testers.

Regards,
YO
Post by Łukasz Nowak
Of course I'll create my own Constraint class for such properties, but
I'd like to know what is your opinion in this case. Shall it be another
Constraint or shall PropertyExistence support such situation? (Or maybe
there is Constraint class for this case which I missed?)
Regards,
Luke
--
Yoshinori Okuji, Nexedi KK President / Nexedi SA CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.co.jp/
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com/
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org/
Loading...