Commit ea8383ad authored by Jérome Perrin's avatar Jérome Perrin

properly support cases where the user does not own the accounting zuite preference

parent 8bacc50c
...@@ -73,14 +73,16 @@ for entity in ( portal.organisation_module.objectValues() +\n ...@@ -73,14 +73,16 @@ for entity in ( portal.organisation_module.objectValues() +\n
# XXX\n # XXX\n
\n \n
# enable preference\n # enable preference\n
pref = portal.portal_preferences.accounting_zuite_preference\n ptool = portal.portal_preferences\n
pref = ptool.accounting_zuite_preference\n
if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n
# we have to \'own\' the preference for the test\n # we have to \'own\' the preference for the test\n
ptool = portal.portal_preferences\n ptool = portal.portal_preferences\n
# pref.setId(\'old_accounting_zuite_preference\')\n # pref.setId(\'old_accounting_zuite_preference\')\n
cb = ptool.manage_copyObjects([\'accounting_zuite_preference\'])\n cb = ptool.manage_copyObjects([\'accounting_zuite_preference\'])\n
# FIXME: how could this work ???\n pasted, = ptool.manage_pasteObjects(cb)\n
ptool.manage_pasteObjects(cb)\n pref = ptool[pasted[\'new_id\']]\n
\n
pref.edit(preferred_accounting_transaction_at_date=None)\n pref.edit(preferred_accounting_transaction_at_date=None)\n
pref.edit(preferred_accounting_transaction_from_date=None)\n pref.edit(preferred_accounting_transaction_from_date=None)\n
pref.edit(preferred_account_number_method=None)\n pref.edit(preferred_account_number_method=None)\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment