Accept Merge Request #1323: (feature/优化返工 -> develop)
Merge Request: 优化返工 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1323
This commit is contained in:
@@ -144,6 +144,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# 是否绑定托盘
|
# 是否绑定托盘
|
||||||
is_trayed = fields.Boolean(string='是否绑定托盘', default=False)
|
is_trayed = fields.Boolean(string='是否绑定托盘', default=False)
|
||||||
|
|
||||||
|
tag_type = fields.Selection([("重新加工", "重新加工")], string="标签", tracking=True)
|
||||||
|
|
||||||
@api.depends('name', 'production_id.name')
|
@api.depends('name', 'production_id.name')
|
||||||
def _compute_surface_technics_picking_ids(self):
|
def _compute_surface_technics_picking_ids(self):
|
||||||
for workorder in self:
|
for workorder in self:
|
||||||
@@ -708,6 +710,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
'date_planned_finished': datetime.now() + timedelta(days=1),
|
'date_planned_finished': datetime.now() + timedelta(days=1),
|
||||||
'duration_expected': duration_expected,
|
'duration_expected': duration_expected,
|
||||||
'duration': 0,
|
'duration': 0,
|
||||||
|
'tag_type': '重新加工' if item is False else False,
|
||||||
'cnc_ids': False if route.routing_type != 'CNC加工' else self.env['sf.cnc.processing']._json_cnc_processing(
|
'cnc_ids': False if route.routing_type != 'CNC加工' else self.env['sf.cnc.processing']._json_cnc_processing(
|
||||||
k, item),
|
k, item),
|
||||||
'cmm_ids': False if route.routing_type != 'CNC加工' else self.env['sf.cmm.program']._json_cmm_program(k,
|
'cmm_ids': False if route.routing_type != 'CNC加工' else self.env['sf.cmm.program']._json_cmm_program(k,
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
</field>
|
</field>
|
||||||
<xpath expr="//field[@name='qty_remaining']" position="after">
|
<xpath expr="//field[@name='qty_remaining']" position="after">
|
||||||
<field name="manual_quotation" optional="show"/>
|
<field name="manual_quotation" optional="show"/>
|
||||||
|
<field name='tag_type' widget="badge"
|
||||||
|
decoration-danger="tag_type == '重新加工'"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='date_planned_start']" position="replace">
|
<xpath expr="//field[@name='date_planned_start']" position="replace">
|
||||||
<field name="date_planned_start" string="计划开始日期" optional="show"/>
|
<field name="date_planned_start" string="计划开始日期" optional="show"/>
|
||||||
@@ -43,11 +45,11 @@
|
|||||||
<field name="date_planned_finished" string="计划结束日期" optional="hide"/>
|
<field name="date_planned_finished" string="计划结束日期" optional="hide"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='button_start']" position="attributes">
|
<xpath expr="//button[@name='button_start']" position="attributes">
|
||||||
<!-- <attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft',-->
|
<!-- <attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft',-->
|
||||||
<!-- 'done',-->
|
<!-- 'done',-->
|
||||||
<!-- 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),-->
|
<!-- 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),-->
|
||||||
<!-- ('is_user_working', '!=', False),("user_permissions","=",False),("name","=","CNC加工")]}-->
|
<!-- ('is_user_working', '!=', False),("user_permissions","=",False),("name","=","CNC加工")]}-->
|
||||||
<!-- </attribute>-->
|
<!-- </attribute>-->
|
||||||
<attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft',
|
<attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft',
|
||||||
'done',
|
'done',
|
||||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||||
@@ -165,8 +167,8 @@
|
|||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> -->
|
<!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> -->
|
||||||
|
|
||||||
<!-- <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"-->
|
<!-- <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"-->
|
||||||
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>-->
|
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>-->
|
||||||
<button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"
|
<button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"
|
||||||
attrs="{'invisible': ['|', '|', '|', '|', '|', ('routing_type', '=', '装夹预调'), ('routing_type', '=', '解除装夹'), ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>
|
attrs="{'invisible': ['|', '|', '|', '|', '|', ('routing_type', '=', '装夹预调'), ('routing_type', '=', '解除装夹'), ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>
|
||||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||||
@@ -191,8 +193,8 @@
|
|||||||
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
||||||
<!-- groups="sf_base.group_sf_mrp_user" -->
|
<!-- groups="sf_base.group_sf_mrp_user" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
||||||
<!-- <button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"-->
|
<!-- <button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"-->
|
||||||
<!-- attrs="{'invisible': ['|','|','|','|',('routing_type','!=','装夹预调'),('is_delivery','=',True),('state','!=','done'),('is_rework','=',True),'&',('rfid_code','in',['',False]),('state','=','done')]}"/>-->
|
<!-- attrs="{'invisible': ['|','|','|','|',('routing_type','!=','装夹预调'),('is_delivery','=',True),('state','!=','done'),('is_rework','=',True),'&',('rfid_code','in',['',False]),('state','=','done')]}"/>-->
|
||||||
<button name="button_rework_pre" type="object" string="返工"
|
<button name="button_rework_pre" type="object" string="返工"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('state','!=','progress'),('is_rework','=',True)]}"/>
|
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('state','!=','progress'),('is_rework','=',True)]}"/>
|
||||||
@@ -221,9 +223,12 @@
|
|||||||
<xpath expr="//label[1]" position="before">
|
<xpath expr="//label[1]" position="before">
|
||||||
<field name='routing_type' readonly="1"/>
|
<field name='routing_type' readonly="1"/>
|
||||||
<field name='process_state' attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
<field name='process_state' attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
|
<field name='tag_type' readonly="1" attrs='{"invisible": [("tag_type","=",False)]}'
|
||||||
|
decoration-danger="tag_type == '重新加工'"/>
|
||||||
<field name="rfid_code" force_save="1" readonly="1" cache="True"
|
<field name="rfid_code" force_save="1" readonly="1" cache="True"
|
||||||
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
||||||
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//label[1]" position="attributes">
|
<xpath expr="//label[1]" position="attributes">
|
||||||
<attribute name="string">计划加工时间</attribute>
|
<attribute name="string">计划加工时间</attribute>
|
||||||
@@ -479,10 +484,10 @@
|
|||||||
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
<field name="data_state" invisible="1"/>
|
<field name="data_state" invisible="1"/>
|
||||||
<!-- <button type="object" class="oe_highlight" name="get_three_check_datas" string="获取数据" -->
|
<!-- <button type="object" class="oe_highlight" name="get_three_check_datas" string="获取数据" -->
|
||||||
<!-- attrs='{"invisible": ["|", "|", "|", ("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", True)]}'/> -->
|
<!-- attrs='{"invisible": ["|", "|", "|", ("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", True)]}'/> -->
|
||||||
<!-- <button type="object" class="oe_highlight" name="getcenter" string="计算定位" -->
|
<!-- <button type="object" class="oe_highlight" name="getcenter" string="计算定位" -->
|
||||||
<!-- attrs='{"invisible": ["|","|", "|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", False)]}'/> -->
|
<!-- attrs='{"invisible": ["|","|", "|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", False)]}'/> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
@@ -515,7 +520,7 @@
|
|||||||
|
|
||||||
<xpath expr="//form//header" position="inside">
|
<xpath expr="//form//header" position="inside">
|
||||||
<button type="object" class="oe_highlight jikimo_button_confirm" name="get_three_check_datas"
|
<button type="object" class="oe_highlight jikimo_button_confirm" name="get_three_check_datas"
|
||||||
string="获取数据" attrs='{"invisible": [("state","!=","progress")]}'/>
|
string="获取数据" attrs='{"invisible": [("state","!=","progress")]}'/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
@@ -666,7 +671,8 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="工件配送" class="center" create="0" delete="0" js_class="remove_focus_list_view">
|
<tree string="工件配送" class="center" create="0" delete="0" js_class="remove_focus_list_view">
|
||||||
<header>
|
<header>
|
||||||
<button name="button_delivery" type="object" string="工件配送" class="btn-primary jikimo_button_confirm" attrs="{'force_show':1}"/>
|
<button name="button_delivery" type="object" string="工件配送"
|
||||||
|
class="btn-primary jikimo_button_confirm" attrs="{'force_show':1}"/>
|
||||||
</header>
|
</header>
|
||||||
<field name="status" widget="badge"
|
<field name="status" widget="badge"
|
||||||
decoration-success="status == '已配送'"
|
decoration-success="status == '已配送'"
|
||||||
@@ -678,15 +684,15 @@
|
|||||||
<field name="production_id"/>
|
<field name="production_id"/>
|
||||||
<field name="type" readonly="1"/>
|
<field name="type" readonly="1"/>
|
||||||
<field name="production_line_id" options="{'no_create': True}" readonly="1"/>
|
<field name="production_line_id" options="{'no_create': True}" readonly="1"/>
|
||||||
<!-- <field name="route_id" options="{'no_create': True}"-->
|
<!-- <field name="route_id" options="{'no_create': True}"-->
|
||||||
<!-- domain="[('route_type','in',['上产线','下产线'])]"/>-->
|
<!-- domain="[('route_type','in',['上产线','下产线'])]"/>-->
|
||||||
<field name="feeder_station_start_id" readonly="1" force_save="1"/>
|
<field name="feeder_station_start_id" readonly="1" force_save="1"/>
|
||||||
<!-- <field name="feeder_station_destination_id" readonly="1" force_save="1"/>-->
|
<!-- <field name="feeder_station_destination_id" readonly="1" force_save="1"/>-->
|
||||||
<field name="is_cnc_program_down" readonly="1"/>
|
<field name="is_cnc_program_down" readonly="1"/>
|
||||||
<!-- <field name="rfid_code"/>-->
|
<!-- <field name="rfid_code"/>-->
|
||||||
<!-- <field name="task_delivery_time" readonly="1"/>-->
|
<!-- <field name="task_delivery_time" readonly="1"/>-->
|
||||||
<!-- <field name="task_completion_time" readonly="1"/>-->
|
<!-- <field name="task_completion_time" readonly="1"/>-->
|
||||||
<!-- <field name="delivery_duration" widget="float_time"/>-->
|
<!-- <field name="delivery_duration" widget="float_time"/>-->
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -853,10 +859,10 @@
|
|||||||
<field name="domain">[('type','in',['运送空料架']),('name','not ilike','WDO')]</field>
|
<field name="domain">[('type','in',['运送空料架']),('name','not ilike','WDO')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="mrp.menu_mrp_manufacturing"
|
<menuitem id="mrp.menu_mrp_manufacturing"
|
||||||
name="Operations"
|
name="Operations"
|
||||||
sequence="10"
|
sequence="10"
|
||||||
parent="mrp.menu_mrp_root"
|
parent="mrp.menu_mrp_root"
|
||||||
groups="sf_base.group_sf_order_user,sf_base.group_sf_mrp_manager,sf_base.group_sf_equipment_user"/>
|
groups="sf_base.group_sf_order_user,sf_base.group_sf_mrp_manager,sf_base.group_sf_equipment_user"/>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,8 @@ from odoo import models, fields, api, _
|
|||||||
class SFMessageSale(models.Model):
|
class SFMessageSale(models.Model):
|
||||||
_name = 'sale.order'
|
_name = 'sale.order'
|
||||||
_inherit = ['sale.order', 'sf.message.template']
|
_inherit = ['sale.order', 'sf.message.template']
|
||||||
|
|
||||||
|
# def create(self):
|
||||||
|
# res = super(SFMessageSale, self).create()
|
||||||
|
# if res is True:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user