增加功能:当为非“自提”单时,必须进行物流下单才能进行出库操作。增加对字段的显隐控制
This commit is contained in:
@@ -46,9 +46,20 @@ class JdEclp(models.Model):
|
||||
is_bill = fields.Boolean(string='是否下了快递单', default=False)
|
||||
# 物流状态
|
||||
logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
|
||||
string='物流状态', default='0')
|
||||
string='物流状态', default='0', readonly=True)
|
||||
|
||||
logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
|
||||
logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式', readonly=True)
|
||||
|
||||
def button_validate(self):
|
||||
"""
|
||||
重写出库方法,获取物流面单
|
||||
"""
|
||||
res = super(JdEclp, self).button_validate()
|
||||
if self.check_out == 'OUT':
|
||||
if self.logistics_way != '自提':
|
||||
if self.logistics_status != '3':
|
||||
raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!')
|
||||
return res
|
||||
|
||||
|
||||
@api.depends('name')
|
||||
|
||||
Reference in New Issue
Block a user