This commit is contained in:
jinling.yang
2023-02-02 18:12:59 +08:00
9 changed files with 59 additions and 14 deletions

View File

@@ -13,7 +13,8 @@
'depends': ['mrp', 'base', 'sf_manufacturing'], 'depends': ['mrp', 'base', 'sf_manufacturing'],
'data': [ 'data': [
'data/product_data.xml', 'data/product_data.xml',
'views/product_template_view.xml' 'views/product_template_view.xml',
'views/product_workorder.xml'
], ],
'demo': [ 'demo': [
], ],

View File

@@ -1,5 +1,6 @@
from. import product_template from. import product_template
from. import product_supplierinfo from. import product_supplierinfo
from. import product_workorder

View File

@@ -0,0 +1,13 @@
from odoo import api, fields, models
class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder'
_order = 'sequence'
product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True, check_company=True, string="胚料长度(mm)")
product_tmpl_id_width = fields.Float(related='production_id.product_tmpl_id.width', readonly=True, store=True, check_company=True, string="胚料宽度(mm)")
product_tmpl_id_height = fields.Float(related='production_id.product_tmpl_id.height', readonly=True, store=True, check_company=True, string="胚料高度(mm)")
product_tmpl_id_materials_id = fields.Many2one(related='production_id.product_tmpl_id.materials_id', readonly=True, store=True, check_company=True, string="材料")
product_tmpl_id_materials_type_id = fields.Many2one(related='production_id.product_tmpl_id.materials_type_id', readonly=True, store=True, check_company=True, string="型号")

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_mrp_production_workorder_tray_form_inherit_sf1" model="ir.ui.view">
<field name="name">production.workorder.dlm</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
<field name="arch" type="xml">
<xpath expr="//page[1]" position="before">
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
<group>
<group>
<field name="product_tmpl_id_materials_id" widget="many2one"/>
<field name="product_tmpl_id_materials_type_id" widget="many2one"/>
</group>
<group>
<field name="product_tmpl_id_length"/>
<field name="product_tmpl_id_width"/>
<field name="product_tmpl_id_height"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -7,7 +7,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page//field[@name='tray_code']" position="before"> <xpath expr="//page//field[@name='tray_code']" position="before">
<!-- invisible="1" --> <!-- invisible="1" -->
<field name="_barcode_scanned" widget="barcode_handler"/> <field name="_barcode_scanned" widget="barcode_handler" string="扫码"/>
</xpath> </xpath>
</field> </field>

View File

@@ -25,7 +25,6 @@
class="btn-primary" attrs='{"invisible": ["|", class="btn-primary" attrs='{"invisible": ["|",
("state","!=","progress"),("user_permissions","=",False)]}'/> ("state","!=","progress"),("user_permissions","=",False)]}'/>
</div> </div>
</div> </div>
</group> </group>
</xpath> </xpath>

View File

@@ -56,7 +56,7 @@
</field> </field>
</record> </record>
<record id="mrp_workcenter_kanban_action1" model="ir.actions.act_window"> <record id="mrp_workcenter_kanban_action1" model="ir.actions.act_window">
<field name="name">工作中心概述</field> <field name="name">工作中心看板</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter</field> <field name="res_model">mrp.workcenter</field>
<field name="view_mode">kanban,form</field> <field name="view_mode">kanban,form</field>
@@ -76,7 +76,7 @@
</record> </record>
<menuitem id="menu_mrp_dashboard" <menuitem id="menu_mrp_dashboard"
name="工作中心概述" name="工作中心看板"
action="mrp_workcenter_kanban_action1" action="mrp_workcenter_kanban_action1"
groups="mrp.group_mrp_routings" groups="mrp.group_mrp_routings"
parent="mrp.menu_mrp_root" parent="mrp.menu_mrp_root"

View File

@@ -7,7 +7,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="name" position="before"> <field name="name" position="before">
<field name="sequence"/> <field name="sequence"/>
<field name='user_permissions'/> <field name='user_permissions' invisible="1"/>
</field> </field>
<field name="name" position="after"> <field name="name" position="after">
<field name="processing_panel"/> <field name="processing_panel"/>
@@ -110,17 +110,26 @@
context="{'default_workcenter_id': workcenter_id}" class="btn-danger" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/> attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
</xpath> </xpath>
<!-- 隐藏物料清单-->
<xpath expr="//page[@name='components']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- 隐藏物料清单-->
<field name="production_id" position="after"> <field name="production_id" position="after">
<group> <group>
<field name="date_planned_start" invisible="1"/>
<field name="date_planned_finished" invisible="1"/>
<field name="duration" widget="mrp_timer" <field name="duration" widget="mrp_timer"
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}" attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
sum="real duration"/> sum="real duration"/>
<field name="processing_panel" readonly="1"/>
</group> </group>
<field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹', <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',
'前置三元定位检测','后置三元质量检测','解除装夹'))]}"/> '前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>
</field> </field>
<xpath expr="//page[1]" position="before"> <xpath expr="//page[1]" position="before">
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'> <page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
<group> <group>
@@ -145,7 +154,6 @@
<page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'> <page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>
<group> <group>
<field name="routing_type" invisible="1"/> <field name="routing_type" invisible="1"/>
<field name="processing_panel" readonly="1"/>
<field name="tray_code"/> <field name="tray_code"/>
<field name="tray_id" readonly="1"/> <field name="tray_id" readonly="1"/>
@@ -159,12 +167,8 @@
</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>
<field name="processing_panel" readonly="1"/>
</group>
</group>
<div>左面:</div> <div>左面:</div>
<div class="o_address_format"> <div class="o_address_format">
<label for="X1_axis" string="x"/> <label for="X1_axis" string="x"/>

View File

@@ -11,7 +11,7 @@
</field> </field>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace"> <xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
<field name="name" widget="section_and_note_text" optional="show" <field name="name" widget="section_and_note_text" optional="show"
string="参数说明(长宽高,体积精度材质)"/> string="参数说明(长/宽/高/体积/精度/材质)"/>
</xpath> </xpath>
</field> </field>
</record> </record>