def revise(self): header = getOr404(DeliverHeader, _g('id'), redirect_url = self.default()) if header.destination_province_id: destination_cites = header.destination_province.children() else: destination_cites = [] return {'header' : header, 'destination_cites' : destination_cites}
def delete(self): header = getOr404(OrderHeader, _g('id'), redirect_url = self.default()) header.active = 1 DBSession.add(SystemLog( type = header.__class__.__name__, ref_id = header.id, remark = u"%s 删除该记录。" % session['user_profile']['name'], )) DBSession.commit() flash(MSG_DELETE_SUCC, MESSAGE_INFO) return redirect(url_for('.view', action = 'index'))
def delete(self): header = getOr404(DeliverHeader, _g('id'), redirect_url = self.default()) header.active = 1 for d in header.details: d.active = 1 d.order_header.deliver_header_no = None d.order_header.deliver_header_ref = None d.order_header.status = ORDER_NEW[0] DBSession.add(SystemLog( type = header.__class__.__name__, ref_id = header.id, remark = u'%s 删除送货该送货单。' % session['user_profile']['name'] )) DBSession.commit() flash(MSG_DELETE_SUCC, MESSAGE_INFO) return redirect(url_for('.view', action = 'index'))