Erreur currency [résolu]
#1
Bonjour à tous,

je me suis finalement décidé à utiliser CREME après l'avoir essayé à son lancement. Sauf qu'il m'arrive un léger problème. Impossible de valider un devis, une facture ou une opportunité. La problème semble venir du module currency.py et de l'encodage en utf8.

Voici en tout cas l'erreur du serveur :
Code :
2012-11-02 14:10:51,270 - django.request - ERROR - Internal Server Error: /billing/quote/24
Traceback (most recent call last):
  File "/serveur/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/serveur/lib/python2.6/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/serveur/lib/python2.6/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/serveur/creme/billing/views/quote.py", line 59, in detailview
    'can_create_invoice': has_perm('billing.add_invoice'),
  File "/serveur/creme/creme_core/views/generic/detailview.py", line 47, in view_entity
    return render(request, template, template_dict)
  File "/serveur/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 44, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),
  File "/serveur/lib/python2.6/site-packages/django/template/loader.py", line 188, in render_to_string
    return t.render(context_instance)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 123, in render
    return self._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/loader_tags.py", line 64, in render
    result = block.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/creme/creme_core/templatetags/creme_block.py", line 664, in render
    return ''.join(op for op in self.block_outputs(context))
  File "/serveur/creme/creme_core/templatetags/creme_block.py", line 664, in <genexpr>
    return ''.join(op for op in self.block_outputs(context))
  File "/serveur/creme/creme_core/templatetags/creme_block.py", line 661, in block_outputs
    yield detailview_display(context)
  File "/serveur/creme/creme_core/gui/block.py", line 106, in _simple_detailview_display
    update_url='/creme_core/blocks/reload/%s/%s/' % (self.id_, entity.pk),
  File "/serveur/creme/crontext)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 792, in render
    output = self.filter_expression.resolve(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 536, in resolve
    new_obj = func(obj, *arg_vals)
  File "/serveur/creme/creme_core/templatetags/creme_core_tags.py", line 191, in format_amount
    return currency(amount, currency_id)
  File "/serveur/creme/creme_core/utils/currency_format.py", line 44, in currency
    locale.setlocale(locale.LC_MONETARY, '')
  File "/serveur/lib/python2.6/locale.py", line 513, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale settingeme_core/gui/block.py", line 100, in _render
    return get_template(self.template_name).render(Context(template_context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 123, in render
    return self._render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 792, in render
    output = self.filter_expression.resolve(context)
  File "/serveur/lib/python2.6/site-packages/django/template/base.py", line 536, in resolve
    new_obj = func(obj, *arg_vals)
  File "/serveur/creme/creme_core/templatetags/creme_core_tags.py", line 191, in format_amount
    return currency(amount, currency_id)
  File "/serveur/creme/creme_core/utils/currency_format.py", line 44, in currency
    locale.setlocale(locale.LC_MONETARY, '')
  File "/serveur/lib/python2.6/locale.py", line 513, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting

Une idée ?

Merci d'avance et encore félicitation.
  Répondre
#2
Bonjour,
On va regarder de notre coté, mais apparemment cela sera du au fait que les locales ne soit pas générées.
Est-ce que vos locales sont bien générées ? Et la constante LC_ALL mise à la bonne valeur ? (avec un export LC_ALL="fr_FR" par exemple) ?
  Répondre
#3
Bonjour,

effectivement, il s'agissait d'un problème serveur. La commande
Code :
export LC_ALL
ne fonctionnait pas. Il m'a fallu faire quelques petites recherches sur ubuntu-fr pour finalement trouver la solution :

Code :
sudo locale-gen fr_FR.utf8

Donc me voilà désormais utilisateur de Crème en espérant pouvoir, par la suite, apporter ma pierre à l'édifice.
  Répondre


Atteindre :


Utilisateur(s) parcourant ce sujet : 2 visiteur(s)