工单流程代码合并
This commit is contained in:
@@ -10,13 +10,19 @@
|
||||
""",
|
||||
'category': 'YZ',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp'],
|
||||
'depends': ['account', 'base', 'mrp','sale'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/product_data.xml',
|
||||
'views/mrs_base_view.xml',
|
||||
'views/mrs_common_view.xml',
|
||||
"views/menu_view.xml"
|
||||
'views/menu_view.xml',
|
||||
'views/sale_order_view.xml',
|
||||
'views/product_template_view.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
|
||||
|
||||
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -142,13 +142,13 @@
|
||||
action="action_mrs_machine_control_system"/>
|
||||
|
||||
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_partner_views"-->
|
||||
<!-- name="工厂token"-->
|
||||
<!-- parent="menu_mrs_base"-->
|
||||
<!-- sequence="1"-->
|
||||
<!-- action="token_factory_view"-->
|
||||
<!-- />-->
|
||||
<menuitem
|
||||
id="menu_sf_model_type"
|
||||
name="模型类型"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="10"
|
||||
action="action_sf_model_type"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -355,11 +355,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床">
|
||||
<header>
|
||||
<button type="object" class="oe_highlight" name ='enroll_machine_tool' string="机床注册" />
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>
|
||||
</header>
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="MTcode" string="编码" />
|
||||
<field name="MTcode" string="编码"/>
|
||||
|
||||
<field name="brand_id"
|
||||
required="1"
|
||||
@@ -368,7 +368,8 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}" domain="[('brand_id', '=', brand_id)]" attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}"
|
||||
domain="[('brand_id', '=', brand_id)]" attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
@@ -489,4 +490,61 @@
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------模型类型------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_model_type_view">
|
||||
<field name="name">search.sf.model.type</field>
|
||||
<field name="model">sf.model.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="模型类型">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="[('name', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_model_type_view">
|
||||
<field name="name">tree.sf.model.type</field>
|
||||
<field name="model">sf.model.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="模型类型">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_sf_model_type">
|
||||
<field name="name">form.sf.model.type</field>
|
||||
<field name="model">sf.model.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="模型类型">
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name='routing_tmpl_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="route_workcenter_id" string="工序"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_model_type" model="ir.actions.act_window">
|
||||
<field name="name">模型类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.model.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[模型类型] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -293,24 +293,10 @@
|
||||
<field name="name">sf.tray.search</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
|
||||
|
||||
<search string="托盘">
|
||||
<field name="name" string="名称" filter_domain="[('name','like',self)]"/>
|
||||
<field name="code" string="编码" filter_domain="[('code','like',self)]"/>
|
||||
|
||||
</search>
|
||||
<group string="分组">
|
||||
<filter name="state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
|
||||
</group>
|
||||
<!-- </group>-->
|
||||
|
||||
<search string="托盘">
|
||||
<field name="name" string="名称" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -347,18 +333,5 @@
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_sf_tray" model="ir.actions.act_window">
|
||||
<field name="name">托盘</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.tray</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
创建托盘吧
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -13,8 +13,7 @@
|
||||
'depends': ['sale', 'sf_base'],
|
||||
'data': [
|
||||
'data/product_data.xml',
|
||||
'views/product_template_view.xml',
|
||||
'views/sale_order_view.xml'
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -99,30 +99,6 @@ class StockRule(models.Model):
|
||||
# in order to to batch the read. We also make a sanitary check on the
|
||||
# `location_src_id` field.
|
||||
|
||||
# list1 = []
|
||||
# for item in procurements:
|
||||
# num = int(item[0].product_qty)
|
||||
# if num > 1:
|
||||
# for no in range(1, num+1):
|
||||
#
|
||||
# Procurement = namedtuple('Procurement', ['product_id', 'product_qty',
|
||||
# 'product_uom', 'location_id', 'name', 'origin',
|
||||
# 'company_id',
|
||||
# 'values'])
|
||||
# s = Procurement(product_id=item[0].product_id,product_qty=1.0,product_uom=item[0].product_uom,
|
||||
# location_id=item[0].location_id,
|
||||
# name=item[0].name,
|
||||
# origin=item[0].origin,
|
||||
# company_id=item[0].company_id,
|
||||
# values=item[0].values,
|
||||
# )
|
||||
# item1 = list(item)
|
||||
# item1[0]=s
|
||||
#
|
||||
# list1.append(tuple(item1))
|
||||
# else:
|
||||
# list1.append(item)
|
||||
|
||||
for procurement, rule in procurements:
|
||||
if not rule.location_src_id:
|
||||
msg = _('No source location defined on stock rule: %s!') % (rule.name,)
|
||||
|
||||
@@ -84,14 +84,15 @@ class MrpWorkOrder(models.Model):
|
||||
_inherit = 'mrp.workorder'
|
||||
_description = '工单'
|
||||
|
||||
cnc_id = fields.Many2one('ir.attachment', string='CNC程序')
|
||||
tray_ids = fields.One2many('sf.tray', 'workorder_id', string='托盘')
|
||||
# def get_tray_info(self):
|
||||
# @api.onchange('X_axis', 'Y_axis', 'Z_axis')
|
||||
# def get_center_point(self):
|
||||
# return 'X:%s,Y:%s,Z:%s' % (self.X_axis, self.Y_axis, self.Z_axis)
|
||||
# 加工面
|
||||
surface = fields.Selection([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"),
|
||||
("上面", "上面")], string="加工面1")
|
||||
# surface = fields.Selection([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"),
|
||||
# ("上面", "上面")], string="加工面1")
|
||||
|
||||
material_center_point = fields.Char(string='配料中心点')
|
||||
X1_axis = fields.Float(string='Lx1', default=0)
|
||||
@@ -203,3 +204,10 @@ class MrpProduction(models.Model):
|
||||
_description = "制造订单"
|
||||
|
||||
tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘")
|
||||
|
||||
class Attachment(models.Model):
|
||||
_inherit = 'ir.attachment'
|
||||
|
||||
cnc_model = fields.Binary('cnc文件', attachment=False)
|
||||
model_name = fields.Char('模型名称')
|
||||
|
||||
|
||||
@@ -6,10 +6,20 @@
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[last()]" position="after">
|
||||
<page string="获取CNC加工程序">
|
||||
<group>
|
||||
<field name="cnc_id" />
|
||||
|
||||
|
||||
</group>
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//page[last()]" position="after">
|
||||
<page string="装夹托盘">
|
||||
<group>
|
||||
<field name="surface" widget="radio"/>
|
||||
<field name="processing_panel" readonly = "1"/>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="gettray" string="扫描托盘"
|
||||
attrs='{"invisible": [("production_id","=",False)]}'
|
||||
@@ -25,7 +35,7 @@
|
||||
<page string="三元前置检测定位参数">
|
||||
<group>
|
||||
<group>
|
||||
<field name="surface" widget="radio"/>
|
||||
<field name="processing_panel" readonly = "1"/>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user