summaryrefslogtreecommitdiff
path: root/ishtar/furnitures
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures')
-rw-r--r--ishtar/furnitures/forms.py4
-rw-r--r--ishtar/furnitures/models.py13
-rw-r--r--ishtar/furnitures/urls.py3
-rw-r--r--ishtar/furnitures/views.py2
4 files changed, 17 insertions, 5 deletions
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py
index 642da9b4b..821ef1bb9 100644
--- a/ishtar/furnitures/forms.py
+++ b/ishtar/furnitures/forms.py
@@ -1631,10 +1631,7 @@ class RecordWizard(Wizard):
r = super(RecordWizard, self).done(request, storage, form_list,
return_object=True, **kwargs)
if type(r) not in (list, tuple) or len(r) != 2:
- print 1
- print r
return r
- print 2
obj, res = r
for form in form_list:
if not hasattr(form, 'prefix') \
@@ -1646,7 +1643,6 @@ class RecordWizard(Wizard):
if not frm.is_valid():
continue
dct = frm.cleaned_data.copy()
- print dct
if not dct:
continue
try:
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py
index c1980f68c..b9dc19afe 100644
--- a/ishtar/furnitures/models.py
+++ b/ishtar/furnitures/models.py
@@ -449,6 +449,16 @@ class Operation(BaseHistorizedItem, OwnPerms):
return Q(in_charge=user.person)|Q(history_modifier=user)\
& Q(end_date__isnull=True)
+ """
+ def closing(self):
+ if self.is_active:
+ return
+ for item in self.history.all():
+ if item.is_active():
+ break
+ closing_item = item
+ return {'date':item.history_date, 'user':item.history_modifier}
+"""
class Parcel(LightHistorizedItem):
associated_file = models.ForeignKey(File, related_name='parcels',
blank=True, null=True, verbose_name=_(u"File"))
@@ -549,7 +559,8 @@ class Unit(GeneralType) :
return self.label
class ContextRecord(BaseHistorizedItem, OwnPerms):
- parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"))
+ parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"),
+ related_name='context_records')
label = models.CharField(_(u"Label"), max_length=200)
description = models.TextField(_("Description"), blank=True, null=True)
lenght = models.IntegerField(_(u"Lenght"))
diff --git a/ishtar/furnitures/urls.py b/ishtar/furnitures/urls.py
index 0e28043e2..71a3a116c 100644
--- a/ishtar/furnitures/urls.py
+++ b/ishtar/furnitures/urls.py
@@ -98,6 +98,9 @@ urlpatterns += patterns('ishtar.furnitures.views',
url(BASE_URL + r'show-operation/(?P<pk>.+)?/(?P<type>.+)?$',
'show_operation',
name='show-operation'),
+ url(BASE_URL + r'show-contextrecord/(?P<pk>.+)?/(?P<type>.+)?$',
+ 'show_contextrecord',
+ name='show-contextrecord'),
url(BASE_URL + r'update-current-item/$', 'update_current_item',
name='update-current-item'),
url(BASE_URL + r'get-administrativeact/(?P<type>.+)?$',
diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py
index 1be067454..b212dee77 100644
--- a/ishtar/furnitures/views.py
+++ b/ishtar/furnitures/views.py
@@ -374,6 +374,8 @@ def autocomplete_organization(request, orga_type=None):
for org in organizations])
return HttpResponse(data, mimetype='text/plain')
+show_contextrecord = show_item(models.ContextRecord, 'contextrecord')
+
def action(request, action_slug, obj_id=None, *args, **kwargs):
"""
Action management