示例#1
0
文件: views.py 项目: htwalid/syndic
 def fillresponse(self):
     if (self.item.id is None) and hasattr(settings, "DIACAMMA_MAXOWNER"):
         nb_owner = len(Owner.objects.all())
         if getattr(settings, "DIACAMMA_MAXOWNER") <= nb_owner:
             raise LucteriosException(IMPORTANT,
                                      _('You have the maximum of owners!'))
     XferAddEditor.fillresponse(self)
示例#2
0
 def fillresponse(self):
     if self.item.folder is not None and notfree_mode_connect() and not self.request.user.is_superuser:
         if self.item.folder.cannot_view(self.request.user):
             raise LucteriosException(IMPORTANT, _("No allow to view!"))
         if self.item.folder.is_readonly(self.request.user):
             raise LucteriosException(IMPORTANT, _("No allow to write!"))
     XferAddEditor.fillresponse(self)
示例#3
0
 def fillresponse(self):
     if self.getparam('CHANGE_ART') is not None:
         if self.item.article is not None:
             self.item.designation = self.item.article.designation
             self.item.price = self.item.article.price
             self.item.unit = self.item.article.unit
     XferAddEditor.fillresponse(self)
     self.get_components('article').set_select_query(Article.objects.filter(isdisabled=False))
示例#4
0
 def fillresponse(self):
     if self.item.folder is not None and notfree_mode_connect(
     ) and not self.request.user.is_superuser:
         if self.item.folder.cannot_view(self.request.user):
             raise LucteriosException(IMPORTANT, _("No allow to view!"))
         if self.item.folder.is_readonly(self.request.user):
             raise LucteriosException(IMPORTANT, _("No allow to write!"))
     XferAddEditor.fillresponse(self)
示例#5
0
 def fillresponse(self):
     if (self.item.id is None) and hasattr(settings,
                                           "DIACAMMA_MAXACTIVITY"):
         nb_act = len(Activity.objects.all())
         if getattr(settings, "DIACAMMA_MAXACTIVITY") <= nb_act:
             raise LucteriosException(
                 IMPORTANT, _('You have the maximum of activities!'))
     XferAddEditor.fillresponse(self)
示例#6
0
文件: views.py 项目: loudubewe/syndic
 def fillresponse(self):
     if (self.item.id is None) and hasattr(settings, "DIACAMMA_MAXOWNER"):
         nb_owner = len(Owner.objects.all())
         if getattr(settings, "DIACAMMA_MAXOWNER") <= nb_owner:
             raise LucteriosException(
                 IMPORTANT,
                 _("You can't have more than %s owners!") %
                 settings.DIACAMMA_MAXOWNER)
     XferAddEditor.fillresponse(self)
示例#7
0
 def fillresponse(self):
     self.item.check_date()
     XferAddEditor.fillresponse(self)
     self.actions = []
     if self.no_change:
         if self.added:
             self.add_action(self.get_action(TITLE_MODIFY, "images/ok.png"), params={"SAVE": "YES"})
             self.add_action(EntryAccountClose.get_action(_("Closed"), "images/up.png"), close=CLOSE_YES, params={"REOPEN": "YES"})
         if (self.item.link is None) and self.item.has_third and not self.item.has_cash:
             self.add_action(EntryAccountCreateLinked.get_action(_('Payment'), "images/right.png"), close=CLOSE_YES)
         self.add_action(EntryAccountReverse.get_action(_('Reverse'), 'images/edit.png'), close=CLOSE_YES)
         self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
     else:
         if (self.debit_rest < 0.0001) and (self.credit_rest < 0.0001) and (self.nb_lines > 0):
             self.add_action(EntryAccountValidate.get_action(TITLE_OK, 'images/ok.png'))
         elif self.added:
             self.add_action(self.get_action(TITLE_MODIFY, "images/ok.png"), params={"SAVE": "YES"})
         if self.item.id is None:
             self.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
         else:
             self.add_action(EntryAccountUnlock.get_action(TITLE_CANCEL, 'images/cancel.png'))
示例#8
0
 def fillresponse(self):
     if (self.item.id is not None) and self.item.is_protected:
         raise LucteriosException(IMPORTANT, _("This cost accounting is protected by other modules!"))
     XferAddEditor.fillresponse(self)
示例#9
0
 def fillresponse(self):
     if not docshow_modify_condition(self):
         raise LucteriosException(IMPORTANT, _("No allow to write!"))
     XferAddEditor.fillresponse(self)
示例#10
0
文件: views.py 项目: htwalid/syndic
 def fillresponse(self):
     contact_id = self.getparam(self.getparam('pkname'))
     self.params['contact'] = contact_id
     self.item.contact = AbstractContact.objects.get(id=contact_id)
     XferAddEditor.fillresponse(self)
示例#11
0
 def fillresponse(self):
     if self.item.id is None:
         if Params.getvalue("accounting-system") == '':
             raise LucteriosException(IMPORTANT, _('Account system not defined!'))
         self.item.init_dates()
     XferAddEditor.fillresponse(self)