新增运送空料架
This commit is contained in:
@@ -430,7 +430,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
if 'DeviceId' in ret:
|
if 'DeviceId' in ret:
|
||||||
logging.info('DeviceId:%s' % ret['DeviceId'])
|
logging.info('DeviceId:%s' % ret['DeviceId'])
|
||||||
if 'IsComplete' in ret:
|
if 'IsComplete' in ret:
|
||||||
if ret['IsComplete'] is True:
|
if ret['IsComplete'] is True or ret['IsComplete'] is False:
|
||||||
for i in range(1, 5):
|
for i in range(1, 5):
|
||||||
logging.info('F-RfidCode:%s' % i)
|
logging.info('F-RfidCode:%s' % i)
|
||||||
if f'RfidCode{i}' in ret:
|
if f'RfidCode{i}' in ret:
|
||||||
@@ -482,7 +482,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('DeviceId:%s' % ret['DeviceId'])
|
logging.info('DeviceId:%s' % ret['DeviceId'])
|
||||||
delivery_Arr = []
|
delivery_Arr = []
|
||||||
if 'IsComplete' in ret:
|
if 'IsComplete' in ret:
|
||||||
if ret['IsComplete'] is True:
|
if ret['IsComplete'] is True or ret['IsComplete'] is False:
|
||||||
for i in range(1, 5):
|
for i in range(1, 5):
|
||||||
logging.info('F-RfidCode:%s' % i)
|
logging.info('F-RfidCode:%s' % i)
|
||||||
if f'RfidCode{i}' in ret:
|
if f'RfidCode{i}' in ret:
|
||||||
|
|||||||
36
sf_manufacturing/data/empty_racks_data.xml
Normal file
36
sf_manufacturing/data/empty_racks_data.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="sequence_workpiece_delivery_1" model="ir.sequence">
|
||||||
|
<field name="name">运送空料架路线:C01-A01</field>
|
||||||
|
<field name="code">sf.workpiece.delivery</field>
|
||||||
|
<field name="prefix">WCA%(year)s%(month)s%(day)s</field>
|
||||||
|
<field name="padding">4</field>
|
||||||
|
<field name="company_id" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sequence_workpiece_delivery_2" model="ir.sequence">
|
||||||
|
<field name="name">运送空料架路线:B01-B02</field>
|
||||||
|
<field name="code">sf.workpiece.delivery</field>
|
||||||
|
<field name="prefix">WBB%(year)s%(month)s%(day)s</field>
|
||||||
|
<field name="padding">4</field>
|
||||||
|
<field name="company_id" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sequence_workpiece_delivery_3" model="ir.sequence">
|
||||||
|
<field name="name">运送空料架路线:B01-A01</field>
|
||||||
|
<field name="code">sf.workpiece.delivery</field>
|
||||||
|
<field name="prefix">WBA%(year)s%(month)s%(day)s</field>
|
||||||
|
<field name="padding">4</field>
|
||||||
|
<field name="company_id" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sequence_workpiece_delivery_4" model="ir.sequence">
|
||||||
|
<field name="name">运送空料架路线:C01-B02</field>
|
||||||
|
<field name="code">sf.workpiece.delivery</field>
|
||||||
|
<field name="prefix">WCB%(year)s%(month)s%(day)s</field>
|
||||||
|
<field name="padding">4</field>
|
||||||
|
<field name="company_id" eval="False"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -1078,6 +1078,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
_name = "sf.workpiece.delivery"
|
_name = "sf.workpiece.delivery"
|
||||||
_description = '工件配送'
|
_description = '工件配送'
|
||||||
|
|
||||||
|
name = fields.Char('名称')
|
||||||
delivery_num = fields.Char('工件配送编码')
|
delivery_num = fields.Char('工件配送编码')
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
|
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
|
||||||
production_id = fields.Many2one('mrp.production', string='制造订单号', readonly=True)
|
production_id = fields.Many2one('mrp.production', string='制造订单号', readonly=True)
|
||||||
@@ -1095,6 +1096,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
status = fields.Selection(
|
status = fields.Selection(
|
||||||
[('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发')
|
[('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发')
|
||||||
is_cnc_program_down = fields.Boolean('程序是否下发', default=False)
|
is_cnc_program_down = fields.Boolean('程序是否下发', default=False)
|
||||||
|
active = fields.Boolean(string="有效", default=True)
|
||||||
|
|
||||||
# @api.model
|
# @api.model
|
||||||
# def create(self, vals):
|
# def create(self, vals):
|
||||||
|
|||||||
@@ -7,8 +7,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):
|
||||||
|
|||||||
@@ -79,12 +79,12 @@
|
|||||||
<field name="work_state" invisible="1"/>
|
<field name="work_state" invisible="1"/>
|
||||||
<field name="schedule_state" invisible='1'/>
|
<field name="schedule_state" invisible='1'/>
|
||||||
<field name="programming_state" readonly="1"/>
|
<field name="programming_state" readonly="1"/>
|
||||||
<field name="production_line_id" readonly="1"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='user_id']" position="before">
|
<xpath expr="//field[@name='user_id']" position="before">
|
||||||
<field name="plan_start_processing_time" readonly="1"/>
|
<field name="plan_start_processing_time" readonly="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
|
<field name="production_line_id" readonly="1"/>
|
||||||
<field name="production_line_state" readonly="1"/>
|
<field name="production_line_state" readonly="1"/>
|
||||||
<field name="part_number"/>
|
<field name="part_number"/>
|
||||||
<field name="part_drawing"/>
|
<field name="part_drawing"/>
|
||||||
|
|||||||
@@ -183,6 +183,8 @@
|
|||||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||||
<field name="equipment_id"
|
<field name="equipment_id"
|
||||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||||
|
<field name="production_line_id"
|
||||||
|
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||||
<field name="production_line_state"
|
<field name="production_line_state"
|
||||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||||
<field name="functional_fixture_id"
|
<field name="functional_fixture_id"
|
||||||
@@ -608,10 +610,10 @@
|
|||||||
<field name="model">sf.workpiece.delivery</field>
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="工件配送">
|
<search string="工件配送">
|
||||||
<filter string="上产线且待下发" name="on_up"
|
<!-- <filter string="上产线且待下发" name="on_up"-->
|
||||||
domain="[('status', '=', '待下发'),('type','=',['上产线'])]"/>
|
<!-- domain="[('status', '=', '待下发'),('type','=',['上产线'])]"/>-->
|
||||||
<filter string="下产线且待下发" name="on_down"
|
<!-- <filter string="下产线且待下发" name="on_down"-->
|
||||||
domain="[('status', '=', '待下发'),('type','=',['下产线'])]"/>
|
<!-- domain="[('status', '=', '待下发'),('type','=',['下产线'])]"/>-->
|
||||||
<filter string="上产线" name="up" domain="[('type', '=', '上产线')]"/>
|
<filter string="上产线" name="up" domain="[('type', '=', '上产线')]"/>
|
||||||
<filter string="下产线" name="down" domain="[('type', '=', '下产线' )]"/>
|
<filter string="下产线" name="down" domain="[('type', '=', '下产线' )]"/>
|
||||||
<field name="production_id"/>
|
<field name="production_id"/>
|
||||||
@@ -634,9 +636,71 @@
|
|||||||
<field name="name">工件配送</field>
|
<field name="name">工件配送</field>
|
||||||
<field name="res_model">sf.workpiece.delivery</field>
|
<field name="res_model">sf.workpiece.delivery</field>
|
||||||
<field name="search_view_id" ref="sf_workpiece_delivery_search"/>
|
<field name="search_view_id" ref="sf_workpiece_delivery_search"/>
|
||||||
<field name="context">{'search_default_on_up':1}</field>
|
<!-- <field name="context">{'search_default_on_up':1}</field>-->
|
||||||
<field name="view_mode">tree,search</field>
|
<field name="view_mode">tree,search</field>
|
||||||
<field name="domain">[('type','in',['上产线','下产线'])]</field>
|
<field name="domain">[('type','in',['上产线','下产线'])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<!--=========================================运送空料架列表======================================-->
|
||||||
|
<record id="sf_workpiece_delivery_empty_racks_template_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" class="center" create="0" delete="0">
|
||||||
|
<header>
|
||||||
|
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
||||||
|
</header>
|
||||||
|
<field name="route_id" options="{'no_create': True}"/>
|
||||||
|
<field name="feeder_station_start_id" readonly="1" force_save="1"/>
|
||||||
|
<field name="feeder_station_destination_id" readonly="1" force_save="1"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="form_sf_workpiece_delivery_empty_racks">
|
||||||
|
<field name="name">运送空料架</field>
|
||||||
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="运送空料架" delete="1">
|
||||||
|
<sheet>
|
||||||
|
<header>
|
||||||
|
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
||||||
|
</header>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="route_id"/>
|
||||||
|
<field name="feeder_station_start_id"/>
|
||||||
|
<field name="feeder_station_destination_id"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="sf_workpiece_delivery_empty_racks_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="route_id"/>
|
||||||
|
<field name="feeder_station_start_id"/>
|
||||||
|
<field name="feeder_station_destination_id"/>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="sf_workpiece_delivery_empty_racks_act" model="ir.actions.act_window">
|
||||||
|
<field name="name">运送空料架</field>
|
||||||
|
<field name="res_model">sf.workpiece.delivery</field>
|
||||||
|
<field name="view_id" ref="sf_workpiece_delivery_empty_racks_template_tree"/>
|
||||||
|
<field name="search_view_id" ref="sf_workpiece_delivery_empty_racks_search"/>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('type','in',['运送空料架'])]</field>
|
||||||
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
|
|||||||
@@ -306,6 +306,14 @@
|
|||||||
action="sf_manufacturing.sf_workpiece_delivery_act"
|
action="sf_manufacturing.sf_workpiece_delivery_act"
|
||||||
parent="mrp.menu_mrp_manufacturing"
|
parent="mrp.menu_mrp_manufacturing"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
id="sf_workpiece_delivery__empty_racks_menu"
|
||||||
|
name="运送空料架"
|
||||||
|
sequence="11"
|
||||||
|
action="sf_manufacturing.sf_workpiece_delivery_empty_racks_act"
|
||||||
|
parent="mrp.menu_mrp_manufacturing"
|
||||||
|
/>
|
||||||
<!-- <menuitem -->
|
<!-- <menuitem -->
|
||||||
<!-- id="sale_custom_menu" -->
|
<!-- id="sale_custom_menu" -->
|
||||||
<!-- name="报价单" -->
|
<!-- name="报价单" -->
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
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
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from stl import mesh
|
from stl import mesh
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
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.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user