物流相关增量开发,修改一些原生按钮,修改一些翻译
This commit is contained in:
@@ -33,6 +33,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])
|
||||
logging.info('get_bfm_process_or===================================:%s' % order_id.name)
|
||||
aa.default_code = kw['order_number']
|
||||
aa.logistics_way = kw['logistics_way']
|
||||
logging.info('get_bfm_process_order_listaaaaaaaaaaaaaaaaaaaaaaaaaaaa================:%s' % aa.default_code)
|
||||
for item in bfm_process_order_list:
|
||||
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
|
||||
|
||||
@@ -42,6 +42,14 @@ class JdEclp(models.Model):
|
||||
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
||||
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
||||
check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out')
|
||||
# 是否下了快递单
|
||||
is_bill = fields.Boolean(string='是否下了快递单', default=False)
|
||||
# 物流状态
|
||||
logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
|
||||
string='物流状态', default='0')
|
||||
|
||||
logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
|
||||
|
||||
|
||||
@api.depends('name')
|
||||
def _check_is_out(self):
|
||||
@@ -68,6 +76,7 @@ class JdEclp(models.Model):
|
||||
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
|
||||
# self.receiverCountyName and self.receiverTownName:
|
||||
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||
self.logistics_way = sale_order_id.logistics_way
|
||||
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
||||
# if sale_order_id.address_of_delivery != False:
|
||||
# if not sale_order_id:
|
||||
@@ -141,6 +150,8 @@ class JdEclp(models.Model):
|
||||
response = requests.post(url2, json=json2, data=None)
|
||||
# _logger.info('调用成功2', response.json()['result']['wbNo'])
|
||||
self.carrier_tracking_ref = response.json()['result']['wbNo']
|
||||
self.is_bill = True
|
||||
self.logistics_status = '1'
|
||||
|
||||
# else:
|
||||
# raise UserError("选择京东物流才能下单呦")
|
||||
@@ -180,3 +191,4 @@ class JdEclp(models.Model):
|
||||
# 'model_name': 'stock.picking',
|
||||
})
|
||||
_logger.info(attachment)
|
||||
self.logistics_status = '2'
|
||||
|
||||
@@ -12,16 +12,29 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="sf_bf_connect_vpicktree" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">sf.bf.connect.vpicktree</field> -->
|
||||
<!-- <field name="model">stock.picking</field> -->
|
||||
<!-- <field name="inherit_id" ref="stock.vpicktree"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <field name="state" position="after"> -->
|
||||
<!-- <field name="logistics_status" string="物流状态"/> -->
|
||||
<!-- </field> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
|
||||
<record id="custom_view_picking_form" model="ir.ui.view">
|
||||
<field name="name">物流</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//header//button[@name='action_assign']" position="after">
|
||||
<field name="is_bill" invisible="True"/>
|
||||
<field name="logistics_status" invisible="True"/>
|
||||
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
|
||||
attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
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')]}"/>
|
||||
attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', False), ('logistics_way', '=', '自提']]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -31,6 +44,12 @@
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<field name="location_id" position="after">
|
||||
<field name="logistics_status"/>
|
||||
<field name="logistics_way"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//group//field[@name='carrier_id']" position="after">
|
||||
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> -->
|
||||
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
@@ -48,6 +67,7 @@
|
||||
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="logistics_status"/>
|
||||
</xpath>
|
||||
<xpath expr="//group//field[@name='group_id']" position="after">
|
||||
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
|
||||
Reference in New Issue
Block a user