Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -5,7 +5,7 @@ import requests
|
|||||||
import cpca
|
import cpca
|
||||||
# from odoo.exceptions import UserError
|
# from odoo.exceptions import UserError
|
||||||
# from odoo.exceptions import ValidationError
|
# from odoo.exceptions import ValidationError
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -165,11 +165,17 @@ class JdEclp(models.Model):
|
|||||||
self.is_bill = True
|
self.is_bill = True
|
||||||
self.logistics_status = '1'
|
self.logistics_status = '1'
|
||||||
|
|
||||||
# # 京东物流下单后,销售订单状态改为待收货
|
notification = {
|
||||||
# self.env['sale.order'].search([('name', '=', self.origin)]).write({'scheduled_status': 'to receive'})
|
'type': 'ir.actions.client',
|
||||||
|
'tag': 'display_notification',
|
||||||
# else:
|
'params': {
|
||||||
# raise UserError("选择京东物流才能下单呦")
|
'title': _('成功'),
|
||||||
|
'type': 'success',
|
||||||
|
'message': '物流下单成功',
|
||||||
|
'sticky': False,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return notification
|
||||||
|
|
||||||
def get_bill(self):
|
def get_bill(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<field name="is_bill" invisible="True"/>
|
<field name="is_bill" invisible="True"/>
|
||||||
<field name="logistics_status" invisible="True"/>
|
<field name="logistics_status" invisible="True"/>
|
||||||
<field name="logistics_way" 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', '=', '自提')]}"/>
|
attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
|
||||||
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
|
<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', '=', '自提')]}"/>
|
||||||
@@ -45,16 +45,26 @@
|
|||||||
<field name="model">stock.picking</field>
|
<field name="model">stock.picking</field>
|
||||||
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
|
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
|
||||||
<field name="location_id" position="after">
|
<field name="location_id" position="after">
|
||||||
<field name="logistics_status" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="logistics_status" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="logistics_way" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="logistics_way" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
</field>
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<xpath expr="//group//field[@name='carrier_id']" position="after">
|
<record id="tracking_only_view" model="ir.ui.view">
|
||||||
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> -->
|
<field name="name">tracking only</field>
|
||||||
|
<field name="model">stock.picking</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//form//sheet//notebook//page[@name='operations']" position="after">
|
||||||
|
<page string="发货信息" name="tracking">
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
|
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
|
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
@@ -64,23 +74,21 @@
|
|||||||
<field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
|
||||||
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
|
||||||
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
</group>
|
||||||
|
<group>
|
||||||
<field name="logistics_status"/>
|
<field name="logistics_status"/>
|
||||||
</xpath>
|
<field name="carrier_id"/>
|
||||||
<xpath expr="//group//field[@name='group_id']" position="after">
|
<field name="carrier_tracking_ref"/>
|
||||||
|
|
||||||
|
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}" string='面单下载'/>
|
||||||
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
|
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!-- <xpath expr="//group[@name='other_infos']" position="after"> -->
|
|
||||||
<!-- <div> -->
|
|
||||||
<!-- <button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"/> -->
|
|
||||||
<!-- </div> -->
|
|
||||||
<!-- <div> -->
|
|
||||||
<!-- <button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"/> -->
|
|
||||||
<!-- </div> -->
|
|
||||||
<!-- </xpath> -->
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -30,12 +30,12 @@ class MrpProduction(models.Model):
|
|||||||
# ('completed', '已完工')
|
# ('completed', '已完工')
|
||||||
# ])
|
# ])
|
||||||
state = fields.Selection([
|
state = fields.Selection([
|
||||||
('draft', 'Draft'),
|
('draft', '待排程'),
|
||||||
('confirmed', 'Confirmed'),
|
('confirmed', '待加工'),
|
||||||
('progress', '待排程'),
|
('progress', '加工中'),
|
||||||
('pending_cam', '待装夹'),
|
# ('pending_cam', '待装夹'),
|
||||||
('pending_processing', '待加工'),
|
# ('pending_processing', '待加工'),
|
||||||
('pending_era_cam', '待解除装夹'),
|
# ('pending_era_cam', '待解除装夹'),
|
||||||
('completed', '已完工'),
|
('completed', '已完工'),
|
||||||
('to_close', 'To Close'),
|
('to_close', 'To Close'),
|
||||||
('done', 'Done'),
|
('done', 'Done'),
|
||||||
@@ -113,18 +113,36 @@ class MrpProduction(models.Model):
|
|||||||
production.state = 'progress'
|
production.state = 'progress'
|
||||||
|
|
||||||
# 新添加的状态逻辑
|
# 新添加的状态逻辑
|
||||||
if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹':
|
if production.state == 'to_close' and production.schedule_state == '未排':
|
||||||
|
production.state = 'draft'
|
||||||
|
elif production.state == 'to_close' and production.schedule_state == '已排':
|
||||||
|
production.state = 'confirmed'
|
||||||
|
# if production.schedule_state == '已完成':
|
||||||
|
# production.state = 'completed'
|
||||||
|
elif any(wo_state in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
|
||||||
|
production.state = 'progress'
|
||||||
|
elif production.product_uom_id and not float_is_zero(production.qty_producing,
|
||||||
|
precision_rounding=production.product_uom_id.rounding):
|
||||||
|
production.state = 'progress'
|
||||||
|
elif any(not float_is_zero(move.quantity_done,
|
||||||
|
precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding)
|
||||||
|
for move in production.move_raw_ids):
|
||||||
|
production.state = 'progress'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹':
|
||||||
|
# # production.state = 'pending_processing'
|
||||||
|
# production.state = 'pending_cam'
|
||||||
|
# if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
|
||||||
|
# # if production.state == 'pending_cam' and production.process_state == '待加工':
|
||||||
# production.state = 'pending_processing'
|
# production.state = 'pending_processing'
|
||||||
production.state = 'pending_cam'
|
# elif production.state == 'progress' and production.process_state == '待解除装夹':
|
||||||
if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
|
# production.state = 'pending_era_cam'
|
||||||
# if production.state == 'pending_cam' and production.process_state == '待加工':
|
# elif production.state == 'progress' and production.process_state == '已完工':
|
||||||
production.state = 'pending_processing'
|
# production.state = 'completed'
|
||||||
elif production.state == 'progress' and production.process_state == '待解除装夹':
|
# elif production.state == 'progress' and production.work_order_state == '已完成':
|
||||||
production.state = 'pending_era_cam'
|
# production.state = 'completed'
|
||||||
elif production.state == 'progress' and production.process_state == '已完工':
|
|
||||||
production.state = 'completed'
|
|
||||||
elif production.state == 'progress' and production.work_order_state == '已完成':
|
|
||||||
production.state = 'completed'
|
|
||||||
|
|
||||||
def action_check(self):
|
def action_check(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<!-- <attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done -->
|
<!-- <attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done -->
|
||||||
<!-- </attribute> -->
|
<!-- </attribute> -->
|
||||||
<attribute name="statusbar_visible">
|
<attribute name="statusbar_visible">
|
||||||
progress,pending_cam,pending_processing,pending_era_cam,completed,done
|
draft,confirmed,progress,completed,done
|
||||||
</attribute>
|
</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//sheet//group//group[2]//label" position="before">
|
<xpath expr="//sheet//group//group[2]//label" position="before">
|
||||||
|
|||||||
@@ -114488,10 +114488,21 @@ msgid "径跳精度(mm)"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: sf_manufacturing
|
#. module: sf_manufacturing
|
||||||
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress
|
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__draft
|
||||||
msgid "待排程"
|
msgid "待排程"
|
||||||
msgstr "待排程"
|
msgstr "待排程"
|
||||||
|
|
||||||
|
#. module: sf_manufacturing
|
||||||
|
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__process_state__待加工
|
||||||
|
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
|
||||||
|
msgid "待加工"
|
||||||
|
msgstr "待加工"
|
||||||
|
|
||||||
|
#. module: sf_manufacturing
|
||||||
|
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress
|
||||||
|
msgid "待排程"
|
||||||
|
msgstr "加工中"
|
||||||
|
|
||||||
#. module: sf_base
|
#. module: sf_base
|
||||||
#: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy
|
#: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy
|
||||||
msgid "径跳精度(um)"
|
msgid "径跳精度(um)"
|
||||||
|
|||||||
Reference in New Issue
Block a user