Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/新增工件装夹预调工单任务
# Conflicts: # sf_manufacturing/models/mrp_workorder.py
This commit is contained in:
@@ -277,13 +277,13 @@ class ToolGroups(models.Model):
|
|||||||
else:
|
else:
|
||||||
raise ValidationError("机床刀具组发送失败")
|
raise ValidationError("机床刀具组发送失败")
|
||||||
|
|
||||||
def write(self, vals):
|
# def write(self, vals):
|
||||||
obj = super().write(vals)
|
# obj = super().write(vals)
|
||||||
self._register_tool_groups(obj)
|
# self._register_tool_groups(obj)
|
||||||
return obj
|
# return obj
|
||||||
|
#
|
||||||
@api.model_create_multi
|
# @api.model_create_multi
|
||||||
def create(self, vals_list):
|
# def create(self, vals_list):
|
||||||
records = super(ToolGroups, self).create(vals_list)
|
# records = super(ToolGroups, self).create(vals_list)
|
||||||
self._register_tool_groups(records)
|
# self._register_tool_groups(records)
|
||||||
return records
|
# return records
|
||||||
|
|||||||
@@ -50,6 +50,18 @@ class MrpProduction(models.Model):
|
|||||||
work_state = fields.Char('业务状态')
|
work_state = fields.Char('业务状态')
|
||||||
programming_state = fields.Char('编程状态')
|
programming_state = fields.Char('编程状态')
|
||||||
glb_file = fields.Binary("glb模型文件")
|
glb_file = fields.Binary("glb模型文件")
|
||||||
|
production_line_id = fields.Many2one('sf.production.line', string='生产线', compute='_compute_production_line_id',
|
||||||
|
store=True)
|
||||||
|
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
||||||
|
|
||||||
|
@api.depends('name')
|
||||||
|
def _compute_production_line_id(self):
|
||||||
|
for production in self:
|
||||||
|
if production.name:
|
||||||
|
plan_production = self.env['sf.production.plan'].search([('production_id', '=', self.id)])
|
||||||
|
if plan_production:
|
||||||
|
production.production_line_id = plan_production.production_id.id
|
||||||
|
production.plan_start_processing_time = plan_production.date_planned_start
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
|
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
|
||||||
@@ -511,7 +523,7 @@ class MrpProduction(models.Model):
|
|||||||
|
|
||||||
# if completed products make other confirmed/partially_available moves available, assign them
|
# if completed products make other confirmed/partially_available moves available, assign them
|
||||||
done_move_finished_ids = (
|
done_move_finished_ids = (
|
||||||
productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
||||||
lambda m: m.state == 'done')
|
lambda m: m.state == 'done')
|
||||||
done_move_finished_ids._trigger_assign()
|
done_move_finished_ids._trigger_assign()
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
maximum_clamping_force = fields.Char(string="最大夹持力[n]")
|
maximum_clamping_force = fields.Char(string="最大夹持力[n]")
|
||||||
production_line = fields.Char(string="生产线")
|
production_line = fields.Char(string="生产线")
|
||||||
preset_program_information = fields.Char(string="预调程序信息")
|
preset_program_information = fields.Char(string="预调程序信息")
|
||||||
|
workpiece_delivery_id = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
|
||||||
|
|
||||||
@api.onchange('is_ok')
|
@api.onchange('is_ok')
|
||||||
def _onchange_inspection_user_id(self):
|
def _onchange_inspection_user_id(self):
|
||||||
@@ -582,11 +583,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
for move_raw_id in self.production_id.move_raw_ids:
|
for move_raw_id in self.production_id.move_raw_ids:
|
||||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||||
self.production_id.button_mark_done1()
|
self.production_id.button_mark_done1()
|
||||||
# self.production_id.state = 'done'
|
# self.production_id.state = 'done'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
class CNCprocessing(models.Model):
|
||||||
@@ -774,14 +771,33 @@ class SfWorkOrderBarcodes(models.Model):
|
|||||||
# self.pro_code_ok = workorder.pro_code_is_ok(barcode)
|
# self.pro_code_ok = workorder.pro_code_is_ok(barcode)
|
||||||
|
|
||||||
|
|
||||||
class WorkPieceDispatch(models.Model):
|
class WorkPieceDelivery(models.Model):
|
||||||
_name = "mrp.workpiece.dispatch"
|
_name = "sf.workpiece.delivery"
|
||||||
_description = '工件配送'
|
_description = '工件配送'
|
||||||
|
|
||||||
workorder_id = fields.Many2one('mrp.workorder')
|
workorder_id = fields.Many2one('mrp.workorder', string='工单',
|
||||||
workorder_code = fields.Char(related='workorder_id.','任务编号(工件编码)')
|
domain=[('name', 'in', ('装夹', '解除装夹'))])
|
||||||
|
name = fields.Char(related='workorder_id.production_id.name', string='工件编码/任务编码', store=True)
|
||||||
|
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
||||||
|
workpiece_code = fields.Char('同运工件编码')
|
||||||
|
feeder_station_start = fields.Char('起点接驳站')
|
||||||
|
feeder_station_destination = fields.Char('目的接驳站')
|
||||||
|
production_line_id = fields.Many2one('sf.production.line', string='目标生产线')
|
||||||
|
task_delivery_time = fields.Datetime('任务下发时间')
|
||||||
|
task_completion_time = fields.Datetime('任务完成时间')
|
||||||
|
delivery_time = fields.Char('配送时长', compute='_compute_delivery_time')
|
||||||
|
status = fields.Selection([('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态',
|
||||||
|
default='待下发')
|
||||||
|
|
||||||
|
@api.depends('task_delivery_time', 'task_completion_time')
|
||||||
|
def _compute_delivery_time(self):
|
||||||
|
for obj in self:
|
||||||
|
if obj.task_delivery_time and obj.task_completion_time:
|
||||||
|
delivery_duration = obj.task_completion_time - obj.task_delivery_time
|
||||||
|
hours, seconds = divmod(delivery_duration.total_seconds(), 3600)
|
||||||
|
minutes, _ = divmod(seconds, 60)
|
||||||
|
delivery_time_str = "{:.0f}时 {:.0f}分".format(hours, minutes)
|
||||||
|
|
||||||
|
obj.delivery_time = delivery_time_str
|
||||||
|
else:
|
||||||
|
obj.delivery_time = ''
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
@@ -874,6 +874,20 @@ class SfMaintenanceEquipmentTool(models.Model):
|
|||||||
code = fields.Char('机床刀位号')
|
code = fields.Char('机床刀位号')
|
||||||
name = fields.Char('刀位号', compute='_compute_name')
|
name = fields.Char('刀位号', compute='_compute_name')
|
||||||
|
|
||||||
|
# 待删除字段
|
||||||
|
product_template_id = fields.Many2one('product.template', string='功能刀具名称',
|
||||||
|
domain="[('categ_type', '=', '刀具')]")
|
||||||
|
image_1920 = fields.Binary('图片', related='product_template_id.image_1920')
|
||||||
|
categ_type = fields.Char(string='功能刀具类型')
|
||||||
|
diameter = fields.Char('直径')
|
||||||
|
precision = fields.Char('粗\中\精')
|
||||||
|
tool_code = fields.Char('功能刀具编码')
|
||||||
|
hilt_name = fields.Char('刀柄名称')
|
||||||
|
hilt_code = fields.Char('刀柄编码')
|
||||||
|
life_value_max = fields.Char('最大寿命值')
|
||||||
|
alarm_value = fields.Char('报警值')
|
||||||
|
used_value = fields.Char('已使用值')
|
||||||
|
|
||||||
@api.depends('code')
|
@api.depends('code')
|
||||||
def _compute_name(self):
|
def _compute_name(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ access_mrp_workcenter_manager,mrp_workcenter,model_mrp_workcenter,sf_base.group_
|
|||||||
access_mrp_workcenter_productivity,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_user,1,0,0,0
|
access_mrp_workcenter_productivity,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_user,1,0,0,0
|
||||||
access_mrp_workcenter_productivity_manager,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_manager,1,1,1,0
|
access_mrp_workcenter_productivity_manager,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||||
|
|
||||||
|
access_sf_workpiece_delivery,sf_workpiece_delivery,model_sf_workpiece_delivery,sf_base.group_sf_mrp_user,1,0,0,0
|
||||||
|
access_sf_workpiece_delivery_manager,sf_workpiece_delivery,model_sf_workpiece_delivery,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||||
|
|
||||||
access_mrp_workcenter_productivity_loss_manager,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,1,1,0
|
access_mrp_workcenter_productivity_loss_manager,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,1,1,0
|
||||||
access_mrp_workcenter_productivity_loss,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,0,0,0
|
access_mrp_workcenter_productivity_loss,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,0,0,0
|
||||||
access_mrp_workcenter_productivity_loss_type,mrp.workcenter.productivity.loss.type,mrp.model_mrp_workcenter_productivity_loss_type,sf_base.group_sf_mrp_user,1,0,0,0
|
access_mrp_workcenter_productivity_loss_type,mrp.workcenter.productivity.loss.type,mrp.model_mrp_workcenter_productivity_loss_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||||
@@ -87,6 +90,7 @@ access_mrp_production_split,access.mrp.production.split,mrp.model_mrp_production
|
|||||||
access_mrp_production_split_line,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0
|
access_mrp_production_split_line,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0
|
||||||
access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
|
access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
|
||||||
|
|
||||||
|
|
||||||
access_mrp_production_group_plan_dispatch,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,0,0,0
|
access_mrp_production_group_plan_dispatch,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0
|
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0
|
||||||
access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0
|
access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
|||||||
|
@@ -107,19 +107,24 @@
|
|||||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||||
attrs="{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', 'done',
|
attrs="{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', '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加工程序')]}" groups="sf_base.group_sf_mrp_user"/>
|
('is_user_working', '!=', False),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"
|
||||||
<button name="button_pending" type="object" string="暂停" class="btn-warning" groups="sf_base.group_sf_mrp_user"
|
groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||||
|
groups="sf_base.group_sf_mrp_user"
|
||||||
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False),('name','=','获取CNC加工程序')]}"/>
|
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="button_finish" type="object" string="完成" class="btn-success" groups="sf_base.group_sf_mrp_user"
|
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||||
|
groups="sf_base.group_sf_mrp_user"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger" groups="sf_base.group_sf_mrp_user"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
|
groups="sf_base.group_sf_mrp_user"
|
||||||
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
|
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="button_unblock" type="object" string="Unblock"
|
<button name="button_unblock" type="object" string="Unblock"
|
||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger" groups="sf_base.group_sf_mrp_user"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
|
groups="sf_base.group_sf_mrp_user"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
@@ -394,11 +399,24 @@
|
|||||||
<field name='X_deviation_angle'/>
|
<field name='X_deviation_angle'/>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
<page string="工件配送" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||||
|
<field name="workpiece_delivery_id" widget="one2many">
|
||||||
|
<tree>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="workpiece_code"/>
|
||||||
|
<field name="feeder_station_start"/>
|
||||||
|
<field name="feeder_station_destination"/>
|
||||||
|
<field name="production_line_id"/>
|
||||||
|
<field name="task_delivery_time"/>
|
||||||
|
<field name="task_completion_time"/>
|
||||||
|
<field name="production_line_id"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<field name="results" invisible="1"/>
|
<field name="results" invisible="1"/>
|
||||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||||
@@ -440,16 +458,16 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
||||||
<!-- <field name="tray_id" readonly="1"/>-->
|
<!-- <field name="tray_id" readonly="1"/>-->
|
||||||
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
||||||
<!-- <button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"-->
|
<!-- <button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"-->
|
||||||
<!-- attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>-->
|
<!-- attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
||||||
<!-- <button type="action" class="oe_highlight" name="sf_manufacturing.label_sf_tray_code1"-->
|
<!-- <button type="action" class="oe_highlight" name="sf_manufacturing.label_sf_tray_code1"-->
|
||||||
<!-- string="打印标签"-->
|
<!-- string="打印标签"-->
|
||||||
<!-- attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>-->
|
<!-- attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
@@ -479,14 +497,62 @@
|
|||||||
<field name="domain">[('schedule_state', '=', '已排')]</field>
|
<field name="domain">[('schedule_state', '=', '已排')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <menuitem id="menu_mrp_workorder_schedule_todo" -->
|
<!-- <menuitem id="menu_mrp_workorder_schedule_todo" -->
|
||||||
<!-- name="工单" -->
|
<!-- name="工单" -->
|
||||||
<!-- action="mrp_workorder_action_schedule" -->
|
<!-- action="mrp_workorder_action_schedule" -->
|
||||||
<!-- parent="mrp.menu_mrp_manufacturing" -->
|
<!-- parent="mrp.menu_mrp_manufacturing" -->
|
||||||
<!-- sequence="15"/> -->
|
<!-- sequence="15"/> -->
|
||||||
|
|
||||||
<record id="mrp.menu_mrp_workorder_todo" model="ir.ui.menu">
|
<record id="mrp.menu_mrp_workorder_todo" model="ir.ui.menu">
|
||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<!--=========================================工件配送单列表======================================-->
|
||||||
|
<record id="sf_workpiece_delivery_tree" model="ir.ui.view">
|
||||||
|
<field name="name">工件配送单列表</field>
|
||||||
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="工件配送单列表" editable="bottom">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="workpiece_code"/>
|
||||||
|
<field name="feeder_station_start"/>
|
||||||
|
<field name="production_line_id"/>
|
||||||
|
<field name="task_delivery_time"/>
|
||||||
|
<field name="feeder_station_destination"/>
|
||||||
|
<field name="task_completion_time"/>
|
||||||
|
<field name="delivery_time"/>
|
||||||
|
<field name="status"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sf_workpiece_delivery_search" model="ir.ui.view">
|
||||||
|
<field name="name">工件配送单列表</field>
|
||||||
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<search string="工件配送单列表">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="workpiece_code"/>
|
||||||
|
<field name="feeder_station_start"/>
|
||||||
|
<field name="production_line_id"/>
|
||||||
|
<field name="task_delivery_time"/>
|
||||||
|
<field name="feeder_station_destination"/>
|
||||||
|
<field name="task_completion_time"/>
|
||||||
|
<field name="delivery_time"/>
|
||||||
|
<field name="status"/>
|
||||||
|
<searchpanel>
|
||||||
|
<field name="production_line_id" icon="fa-building" enable_counters="1"/>
|
||||||
|
<field name="status" icon="fa-building" enable_counters="1"/>
|
||||||
|
</searchpanel>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sf_workpiece_delivery_act" model="ir.actions.act_window">
|
||||||
|
<field name="name">工件配送单列表</field>
|
||||||
|
<field name="res_model">sf.workpiece.delivery</field>
|
||||||
|
<field name="view_mode">tree,search</field>
|
||||||
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
|
|||||||
@@ -327,6 +327,14 @@
|
|||||||
action="mrp_custom_action"
|
action="mrp_custom_action"
|
||||||
parent="sf_production_plan_menu"
|
parent="sf_production_plan_menu"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
id="sf_workpiece_delivery_menu"
|
||||||
|
name="工件配送单列表"
|
||||||
|
sequence="10"
|
||||||
|
action="sf_manufacturing.sf_workpiece_delivery_act"
|
||||||
|
parent="mrp.menu_mrp_manufacturing"
|
||||||
|
/>
|
||||||
<!-- <menuitem -->
|
<!-- <menuitem -->
|
||||||
<!-- id="sale_custom_menu" -->
|
<!-- id="sale_custom_menu" -->
|
||||||
<!-- name="报价单" -->
|
<!-- name="报价单" -->
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class QualityCheck(models.Model):
|
|||||||
else:
|
else:
|
||||||
raise ValidationError("零件特采发送失败")
|
raise ValidationError("零件特采发送失败")
|
||||||
|
|
||||||
@api.onchange('quality_state')
|
# @api.onchange('quality_state')
|
||||||
def _onchange_quality_state(self):
|
# def _onchange_quality_state(self):
|
||||||
if self.quality_state in ['pass', 'fail']:
|
# if self.quality_state in ['pass', 'fail']:
|
||||||
self._register_tool_groups()
|
# self._register_tool_groups()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
# from quatotion import readSql, feature_recognize, auto_quatotion
|
||||||
|
|
||||||
__author__ = 'jinling.yang'
|
__author__ = 'jinling.yang'
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import os
|
|||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import requests
|
import requests
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|||||||
@@ -198,12 +198,12 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
else:
|
else:
|
||||||
raise ValidationError("刀具组发送失败")
|
raise ValidationError("刀具组发送失败")
|
||||||
|
|
||||||
@api.model_create_multi
|
# @api.model_create_multi
|
||||||
def create(self, vals):
|
# def create(self, vals):
|
||||||
obj = super(FunctionalCuttingToolEntity, self).create(vals)
|
# obj = super(FunctionalCuttingToolEntity, self).create(vals)
|
||||||
# 调用刀具组接口
|
# # 调用刀具组接口
|
||||||
self._register_functional_tool_groups(obj)
|
# self._register_functional_tool_groups(obj)
|
||||||
return obj
|
# return obj
|
||||||
|
|
||||||
|
|
||||||
class FunctionalToolWarning(models.Model):
|
class FunctionalToolWarning(models.Model):
|
||||||
@@ -753,7 +753,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
if functional_tools:
|
if functional_tools:
|
||||||
for functional_tool in functional_tools:
|
for functional_tool in functional_tools:
|
||||||
if functional_tool.on_tool_stock_num == 0:
|
if functional_tool.on_tool_stock_num == 0:
|
||||||
self.env['sf.cnc.processing'].register_cnc_processing(cnc_processing)
|
# self.env['sf.cnc.processing'].register_cnc_processing(cnc_processing)
|
||||||
if functional_tool.tool_stock_num == 0 and functional_tool.side_shelf_num == 0:
|
if functional_tool.tool_stock_num == 0 and functional_tool.side_shelf_num == 0:
|
||||||
status = True
|
status = True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user