def permit_delivery_task_with_abnormal_weight(whom, action, obj, msg, sender, **kwargs): doc = database.codernity_db.get('id', obj.tag, with_doc=True) loader = models.User.query.get(doc['loader_id']) msg = u'装卸工%s完成了剩余重量异常的发货任务,请处理!' % loader.username return models.TODO(user=whom, action=action, obj_pk=obj.id, actor=sender, msg=msg, context_url=url_for('work_flow.node_list'))
def dispatch_order(whom, action, obj, msg, sender, **kwargs): """ 下发订单 """ from lite_mms.basemain import data_browser msg = u'收发员%s下发了一张编号是%s的订单,请预排产!' % ( obj.creator.username if obj.creator else "", obj.customer_order_number) + (msg and " - " + msg) return models.TODO(user=whom, action=action, obj_pk=obj.id, actor=sender, msg=msg, context_url=data_browser.get_form_url(obj))
def pay_consignment(whom, action, obj, msg, sender, **kwargs): """ 收款任务 """ from lite_mms.basemain import data_browser msg = u'收发员%s创建了一张来自%s(车牌号%s)的发货单,请收款!' % ( obj.actor.username if obj.actor else "", obj.customer.name, obj.delivery_session.plate) + (msg and " - " + msg) return models.TODO(user=whom, action=action, obj_pk=obj.id, actor=sender, msg=msg, context_url=data_browser.get_form_url(obj))
def weigh_unload_task(whom, action, obj, msg, sender, **kwargs): """ 称重任务 """ from lite_mms.basemain import data_browser msg = u'装卸工%s完成了一次来自%s(车牌号"%s")卸货任务,请称重!' % ( obj.creator.username, obj.customer.name, obj.unload_session.plate) + ( msg and " - " + msg) return models.TODO(user=whom, action=action, obj_pk=obj.id, actor=sender, msg=msg, context_url=data_browser.get_form_url( obj.unload_session))