Skip to content

Commit

Permalink
优化发货功能
Browse files Browse the repository at this point in the history
  • Loading branch information
elfgzp committed Aug 20, 2017
1 parent 0d50871 commit 14e4da0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,16 @@ class DeliverWizard(models.TransientModel):
_name = 'wechat_mall.deliver.wizard'
_description = u'发货'

order_id = fields.Many2one('wechat_mall.order', string='订单', required=True)
shipper_id = fields.Many2one('wechat_mall.shipper', string='快递承运商', required=True)
tracking_number = fields.Char('运单号', required=True)
order_id = fields.Many2one('wechat_mall.order', string='订单')
shipper_id = fields.Many2one('wechat_mall.shipper', string='快递承运商')
tracking_number = fields.Char('运单号')
status = fields.Char('状态', required=True)

@api.model
def create(self, vals):
order = self.env['wechat_mall.order'].browse(vals.pop('order_id'))
vals['tracking_number'] = vals['tracking_number'].replace(' ', '')
vals['tracking_number'] = vals.get('tracking_number').replace(' ', '') if vals.get(
'tracking_number') is not False else ''
order.write(vals)
return super(DeliverWizard, self).create(vals)

Expand Down
1 change: 1 addition & 0 deletions views/wechat_mall_deliver_wizard_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<field name="shipper_id"/>
<field name="tracking_number"/>
<field name="status" invisible="1"/>
<p>发货信息在发货后可以修改,商户配送可以不设置快递信息。</p>
</group>
</sheet>
<footer>
Expand Down

0 comments on commit 14e4da0

Please sign in to comment.