取消物流单屏蔽
This commit is contained in:
@@ -50,17 +50,16 @@ class JdEclp(models.Model):
|
||||
|
||||
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 != '自提' and self.logistics_way:
|
||||
# if self.logistics_status != '2':
|
||||
# raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!')
|
||||
# return res
|
||||
def button_validate(self):
|
||||
"""
|
||||
重写出库方法,获取物流面单
|
||||
"""
|
||||
res = super(JdEclp, self).button_validate()
|
||||
if self.check_out == 'OUT':
|
||||
if self.logistics_way != '自提' and self.logistics_way:
|
||||
if self.logistics_status != '2':
|
||||
raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!')
|
||||
return res
|
||||
|
||||
|
||||
@api.depends('name')
|
||||
|
||||
@@ -32,11 +32,10 @@
|
||||
<field name="is_bill" invisible="True"/>
|
||||
<field name="logistics_status" invisible="True"/>
|
||||
<field name="logistics_way" invisible="True"/>
|
||||
<!-- 暂时屏蔽物流下单 -->
|
||||
<!-- <button string="物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
|
||||
<button string="物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
|
||||
attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
|
||||
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
|
||||
attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/> -->
|
||||
attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user