Discussion:
[Erp5-dev] broken Account_getGap* scripts
Bartek Gorny
2006-01-09 16:55:06 UTC
Permalink
Hello

Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.

The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.

Bartek
Jérôme Perrin
2006-01-09 17:23:04 UTC
Permalink
Post by Bartek Gorny
Hello
Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.
The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.
Hello,

portal_preference didn't change his behaviour, the only change that have been
done is that now it uses the catalog to search preferences (searchFolder)
instead of using contentValues.
Please make sure that your portal_preference is correctly indexed in the
catalog.
Also, note that you if you have activated user level preferences, they have
precedence over the default site preference, this is the default behaviour of
preference tool, which is described in erp5.org
http://www.erp5.org/workspaces/members/jerome/pub/portal_preferences/view
--
J?rome
Bartek Gorny
2006-01-09 17:46:11 UTC
Permalink
Post by Jérôme Perrin
Post by Bartek Gorny
Hello
Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.
The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.
Hello,
portal_preference didn't change his behaviour, the only change that have been
done is that now it uses the catalog to search preferences (searchFolder)
instead of using contentValues.
Please make sure that your portal_preference is correctly indexed in the
catalog.
What I can say is that portal_preferences/default_site_preference is
in the catalog - can't see the details, however, since a click on a
cataloged object throws a "tuple index out of range" error.

Anyway, it doesn't say it can't find the value, or return None, it
just says "resource not found" when I call
portal_preferences/getPreferredAccountingTransactionGap, so the getter
is just not there.

BG
Post by Jérôme Perrin
Also, note that you if you have activated user level preferences, they have
precedence over the default site preference, this is the default behaviour of
preference tool, which is described in erp5.org
http://www.erp5.org/workspaces/members/jerome/pub/portal_preferences/view
--
J?rome
Bartek Gorny
2006-01-10 16:43:43 UTC
Permalink
Post by Jérôme Perrin
Post by Bartek Gorny
Hello
Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.
The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.
Hello,
portal_preference didn't change his behaviour, the only change that have been
done is that now it uses the catalog to search preferences (searchFolder)
instead of using contentValues.
Please make sure that your portal_preference is correctly indexed in the
catalog.
Seems to be - it is in the catalog. Anyway, it is not the question of
returning None or a wrong value - the getters are just not there, when
I try to call, for example:
portal_preferences.getPreferredAccountingTransactionFromDate()
I get an attribute error, while
portal_preferences.default_site_preference.getPreferredAccountingTransactionFromDate()
works as expected.

In my laptop installation everything is fine, the problem is on the
LiveCD station where everything is from CVS.

Bartek
Post by Jérôme Perrin
Also, note that you if you have activated user level preferences, they have
precedence over the default site preference, this is the default behaviour of
preference tool, which is described in erp5.org
http://www.erp5.org/workspaces/members/jerome/pub/portal_preferences/view
--
J?rome
Jérôme Perrin
2006-01-10 17:37:29 UTC
Permalink
Post by Bartek Gorny
Post by Jérôme Perrin
Post by Bartek Gorny
Hello
Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.
The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.
Hello,
portal_preference didn't change his behaviour, the only change that have
been done is that now it uses the catalog to search preferences
(searchFolder) instead of using contentValues.
Please make sure that your portal_preference is correctly indexed in the
catalog.
Seems to be - it is in the catalog. Anyway, it is not the question of
returning None or a wrong value - the getters are just not there, when
portal_preferences.getPreferredAccountingTransactionFromDate()
I get an attribute error, while
portal_preferences.default_site_preference.getPreferredAccountingTransactio
nFromDate() works as expected.
In my laptop installation everything is fine, the problem is on the
LiveCD station where everything is from CVS.
PreferenceTool overrides _aq_dynamic (which behaviour is similar to
__getattr__ ), so that accessors like
getPreferredAccountingTransactionFromDate not found on the PreferenceTool are
called dynamically on the "best" preference for the user.
Then the 'best' is the first preference (active) in the list returned by
_getSortedPreferenceList wich returns the list of preferences that are
visible to the user according to catalog results (because we use
searchFolder).
My advise is to reindex the whole portal_preference and make sure the
default_preference is 'active' in preference workflow.
--
J?rome
Bartek Gorny
2006-01-10 21:20:05 UTC
Permalink
Shame on me... All that was needed was, indeed, "Enable preference" -
I was stuck in thinking about acquisition and didn't think about
workflows. Thanks for explaining the whole thing!

We'll put this one into "troubleshooting" section :)

B.
Post by Jérôme Perrin
Post by Bartek Gorny
Post by Jérôme Perrin
Post by Bartek Gorny
Hello
Scripts Account_getGapItemList and Account_getGapId are broken because
of a change in behaviour of portal_preferences.
The portal_preferences apparently used to acquire default properties
from default_site_preference (function
getPreferredAccountingTransactionGap returned value of
default_site_preference/preferred_accounting_transaction_gap). Now it
does not, and you have to explicitly call
portal_preferences.default_site_preference.getSomething, the result
being that scripts Account_getGapItemList and Account_getGapId return
nothing.
Hello,
portal_preference didn't change his behaviour, the only change that have
been done is that now it uses the catalog to search preferences
(searchFolder) instead of using contentValues.
Please make sure that your portal_preference is correctly indexed in the
catalog.
Seems to be - it is in the catalog. Anyway, it is not the question of
returning None or a wrong value - the getters are just not there, when
portal_preferences.getPreferredAccountingTransactionFromDate()
I get an attribute error, while
portal_preferences.default_site_preference.getPreferredAccountingTransactio
nFromDate() works as expected.
In my laptop installation everything is fine, the problem is on the
LiveCD station where everything is from CVS.
PreferenceTool overrides _aq_dynamic (which behaviour is similar to
__getattr__ ), so that accessors like
getPreferredAccountingTransactionFromDate not found on the PreferenceTool are
called dynamically on the "best" preference for the user.
Then the 'best' is the first preference (active) in the list returned by
_getSortedPreferenceList wich returns the list of preferences that are
visible to the user according to catalog results (because we use
searchFolder).
My advise is to reindex the whole portal_preference and make sure the
default_preference is 'active' in preference workflow.
--
J?rome
Loading...