[Erp5-dev] [Erp5-report] r31922 luke - /erp5/trunk/products/ERP5/Document/Resource.py

Nicolas Dumazet nicolas.dumazet at nexedi.com
Mon Jan 25 05:48:45 CET 2010


nobody at svn.erp5.org wrote:
> Author: luke
> Date: Fri Jan 22 17:52:29 2010
> New Revision: 31922
>
> URL: http://svn.erp5.org?rev=31922&view=rev
> Log:
>  - allow to work without quantity_unit_conversion_module
>
> quantity_unit_conversion_module can be not accessible, as it is included in
> erp5_pdm business template
>   

Hello Luke!
(I know that you already reverted that change).

I'm curious, do you get important troubles without that change? What 
happens exactly?
Returning {} is probably not enough, let me know what are the issues so 
I can fix those.

For me, this script should only be used to index Quantity Unit 
Conversion Definitions and Measures, which are both in erp5_pdm. Without 
erp5_pdm the code is not run. With an outdated erp5_pdm, Measures are 
not indexed properly until the upgrade. Did I get something wrong?

Thanks :)
> Modified:
>     erp5/trunk/products/ERP5/Document/Resource.py
>
> Modified: erp5/trunk/products/ERP5/Document/Resource.py
> URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Resource.py?rev=31922&r1=31921&r2=31922&view=diff
> ==============================================================================
> --- erp5/trunk/products/ERP5/Document/Resource.py [utf8] (original)
> +++ erp5/trunk/products/ERP5/Document/Resource.py [utf8] Fri Jan 22 17:52:29 2010
> @@ -855,7 +855,10 @@
>      def _getGlobalQuantityUnitDefinitionDict(self):
>        # XXX this info could be cached, as it is the same for all Resources
>        result = {}
> -      module = self.getPortalObject().quantity_unit_conversion_module
> +      module = getattr(self.getPortalObject(),
> +        'quantity_unit_conversion_module', None)
> +      if module is None:
> +        return result
>        for definition_list in module.objectValues(portal_type= \
>            'Quantity Unit Conversion Group'):
>          standard_quantity_unit_uid = definition_list.getQuantityUnitUid()
>
> _______________________________________________
> Erp5-report mailing list
> Erp5-report at erp5.org
> http://mail.nexedi.com/mailman/listinfo/erp5-report
>   


-- 
Nicolas Dumazet
Nexedi
http://www.nexedi.com/




More information about the Erp5-dev mailing list