summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures/models.py')
-rw-r--r--ishtar/furnitures/models.py13
1 files changed, 12 insertions, 1 deletions
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"))