Discussion:
[Erp5-dev] getQuantityPrecision is not always defined on object
Łukasz Nowak
2007-07-17 10:38:12 UTC
Permalink
Hello,

While access account_module on my site I've got AttributeError:
getQuantityPrecision:

Module Products.ERP5Type.Base, line 2678, in
cached_getQuantityPrecisionFromResource 2676 | resource_value =
self.portal_categories.resolveCategory(resource) 2677 | if
resource_value is not None:
2678>| return resource_value.getQuantityPrecision()
2679 | return 0
2680 |

Is attached fix good backward-compatibility workaround?

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...''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Base.py-getQuantityPrecision-not-always-defined.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070717/1f852ecb/attachment.bin>
Jerome Perrin
2007-07-20 07:45:55 UTC
Permalink
Post by Łukasz Nowak
Hello,
Module Products.ERP5Type.Base, line 2678, in
cached_getQuantityPrecisionFromResource
2676 | resource_value = self.portal_categories.resolveCategory(resource)
2678>| return resource_value.getQuantityPrecision()
2679 | return 0
2680 |
Hello,

Can you still check what is resource here, and what is the portal_type
of resource_value ?

J?rome
Łukasz Nowak
2007-07-20 08:09:11 UTC
Permalink
Hello,

On 2007-07-20, 09:45:55
Post by Łukasz Nowak
Post by Łukasz Nowak
Hello,
Module Products.ERP5Type.Base, line 2678, in
cached_getQuantityPrecisionFromResource
2676 | resource_value =
self.portal_categories.resolveCategory(resource) 2677 | if
2678>| return resource_value.getQuantityPrecision()
2679 | return 0
2680 |
Hello,
Can you still check what is resource here, and what is the
portal_type of resource_value ?
It was account_module/2 <Account 2>.

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...''
Jérôme Perrin
2007-07-23 08:00:24 UTC
Permalink
Post by Łukasz Nowak
Post by Jerome Perrin
Can you still check what is resource here, and what is the
portal_type of resource_value ?
It was account_module/2 <Account 2>.
Thanks.

As far as I know, it has never been possible to set an account as resource. Do
you think this can be the result of experimentations on your side ?

J?rome
Łukasz Nowak
2007-07-23 08:09:28 UTC
Permalink
Hello,

On 2007-07-23, 10:00:24
Post by Jérôme Perrin
Post by Łukasz Nowak
It was account_module/2 <Account 2>.
Thanks.
As far as I know, it has never been possible to set an account as
resource. Do you think this can be the result of experimentations on
your side ?
It was introduced after upgrade from 10526 to HEAD. But
after some playing with site, I wasn't able to reproduce it.
As soon as I run on this problem again, I'll investigate what made
account as resource.

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...''
Loading...