def _an_task_config(self): from autonomie.models.task import ( PaymentConditions, ) for i in self.session.query(PaymentConditions): self.session.delete(i) for index, label in enumerate( [u"30 jours fin de mois", u"À réception de facture"]): condition = PaymentConditions(label=label) if index == 0: condition.default = True self.session.add(condition)
def _an_task_config(self): from autonomie.models.task import ( PaymentConditions, ) for i in self.session.query(PaymentConditions): self.session.delete(i) for index, label in enumerate( [u"30 jours fin de mois", u"À réception de facture"] ): condition = PaymentConditions(label=label) if index == 0: condition.default = True self.session.add(condition)
def deferred_default_payment_condition(node, kw): entry = PaymentConditions.query().filter( PaymentConditions.default == True).first() if entry is not None: return entry.label else: return ""
def deferred_default_payment_condition(node, kw): entry = PaymentConditions.query().filter( PaymentConditions.default==True ).first() if entry is not None: return entry.label else: return ""
def json_payment_conditions(request): """ Return The PaymentConditions objects available for the given form :param obj request: The current request object :returns: List of PaymentConditions in their json repr """ query = PaymentConditions.query() return [item.__json__(request) for item in query]