master-sf1.0
This commit is contained in:
84
sf_manufacturing/views/model_type_view.xml
Normal file
84
sf_manufacturing/views/model_type_view.xml
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
#------------------模型类型------------------
|
||||
|
||||
<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"/>
|
||||
<field name="embryo_tolerance" required="1" string="胚料容余(mm)"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name='product_routing_tmpl_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle" string="序号"/>
|
||||
<field name="route_workcenter_id" string="工序"/>
|
||||
<field name="routing_type" string="类型"/>
|
||||
<field name="is_repeat" string="重复"/>
|
||||
<field name="workcenter_ids" string="工作中心" widget="many2many_tags"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group>
|
||||
<field name='embryo_routing_tmpl_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle" string="序号"/>
|
||||
<field name="route_workcenter_id" string="工序"/>
|
||||
<field name="routing_type" string="类型"/>
|
||||
<field name="is_repeat" string="重复"/>
|
||||
<field name="workcenter_ids" string="工作中心" widget="many2many_tags"/>
|
||||
</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>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_model_type"
|
||||
name="模型类型"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="10"
|
||||
action="action_sf_model_type"
|
||||
/>
|
||||
</data>
|
||||
</odoo>
|
||||
105
sf_manufacturing/views/mrp_maintenance_views.xml
Normal file
105
sf_manufacturing/views/mrp_maintenance_views.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="maintenance_equipment_view_form_inherit_mrp" model="ir.ui.view">
|
||||
<field name="name">maintenance.equipment.view.form.inherit.mrp</field>
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="button_mrp_workcenter" type="object" class="oe_stat_button"
|
||||
icon="fa-cogs" string="Work Center" attrs="{'invisible': [('workcenter_id', '=', False)]}"
|
||||
groups="mrp.group_mrp_routings">
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='location']" position="after">
|
||||
<field name="workcenter_id" context="{'default_company_id':company_id}"
|
||||
groups="mrp.group_mrp_routings"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='maintenance']" position="after">
|
||||
<group name="statistics">
|
||||
<label for="expected_mtbf" string="Expected Mean Time Between Failure"/>
|
||||
<div class="o_row">
|
||||
<field name="expected_mtbf"/>
|
||||
days
|
||||
</div>
|
||||
<label for="mtbf" string="Mean Time Between Failure"/>
|
||||
<div class="o_row">
|
||||
<field name="mtbf"/>
|
||||
days
|
||||
</div>
|
||||
<label for="estimated_next_failure" string="Estimated Next Failure"/>
|
||||
<div class="o_row">
|
||||
<field name="estimated_next_failure"/>
|
||||
</div>
|
||||
<field name="latest_failure_date" string="Latest Failure"/>
|
||||
<label for="mttr" string="Mean Time To Repair"/>
|
||||
<div class="o_row">
|
||||
<field name="mttr"/>
|
||||
days
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="maintenance_request_view_form_inherit_mrp" model="ir.ui.view">
|
||||
<field name="name">maintenance.request.view.form.inherit.mrp</field>
|
||||
<field name="model">maintenance.request</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='maintenance_type']" position="after">
|
||||
<field name="production_company_id" invisible="1"/>
|
||||
<field name="workorder_id" invisible="1"/>
|
||||
<field name="production_id" options="{'no_create': True, 'no_open': True}"/>
|
||||
<field name="workorder_id" attrs="{'invisible': [('production_id', '=', False)]}"
|
||||
options="{'no_create': True, 'no_open': True}" domain="[('production_id', '=', production_id)]"
|
||||
groups="mrp.group_mrp_routings"/>
|
||||
<!-- <field name="repair_id"/> -->
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('oe_chatter')]" position="after">
|
||||
<div invisible="not context.get('discard_on_footer_button', False)">
|
||||
<footer class="oe_edit_only">
|
||||
<button special="save" data-hotkey="v" string="Save" class="oe_highlight"/>
|
||||
<button string="Discard" special="cancel" data-hotkey="z"/>
|
||||
</footer>
|
||||
</div>
|
||||
</xpath>
|
||||
<field name="equipment_id" position="attributes">
|
||||
<attribute name="domain">['|', (not workorder_id and 1 or 0, '=', 1), '|', ('workcenter_id', '=',
|
||||
False), ('workcenter_id.order_ids', 'in', workorder_id)]
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="maintenance_request_view_search_inherit_mrp" model="ir.ui.view">
|
||||
<field name="name">maintenence.request.view.search.inherit.mrp</field>
|
||||
<field name="model">maintenance.request</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='maintenance_team_id']" position="after">
|
||||
<field name="production_id" string="Operation"
|
||||
filter_domain="['|', ('production_id', 'ilike', self), ('workorder_id', 'ilike', self)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="maintenance.menu_equipment_form"
|
||||
name="Equipments"
|
||||
parent="maintenance.menu_maintenance_title"
|
||||
groups="maintenance.group_equipment_manager,base.group_user"
|
||||
sequence="2"/>
|
||||
<menuitem id="menu_workcenter_tree"
|
||||
action="mrp.mrp_workcenter_action"
|
||||
groups="mrp.group_mrp_routings"
|
||||
parent="maintenance.menu_equipment_form"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
id="menu_equipment_dashboard"
|
||||
name="Machines & Tools"
|
||||
parent="maintenance.menu_equipment_form"
|
||||
action="maintenance.hr_equipment_action"
|
||||
sequence="2"/>
|
||||
|
||||
</odoo>
|
||||
19
sf_manufacturing/views/mrp_routing_workcenter_view.xml
Normal file
19
sf_manufacturing/views/mrp_routing_workcenter_view.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_mrp_routing_workcenter_form_inherit_sf">
|
||||
<field name="name">mrp.routing.workcenter.form.inherit.sf</field>
|
||||
<field name="model">mrp.routing.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_routing_workcenter_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="workcenter_id" position="replace">
|
||||
<field name="workcenter_ids" widget="many2many_tags" string="工作中心" required="0"/>
|
||||
</field>
|
||||
<field name="bom_product_template_attribute_value_ids" position="after">
|
||||
<field name="routing_type" required="1"/>
|
||||
<field name="is_repeat"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
153
sf_manufacturing/views/mrp_workcenter_views.xml
Normal file
153
sf_manufacturing/views/mrp_workcenter_views.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- 工作中心看板 -->
|
||||
<record id="mrp_production_view_form_inherit_maintenance" model="ir.ui.view">
|
||||
<field name="name">mrp.production.view.form.inherit.maintenance</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_cancel" position="before">
|
||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
||||
</button>
|
||||
<div name="button_box" position="inside">
|
||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||
context="{'search_default_production_id': active_id}">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="maintenance_count"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Maintenance</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">-->
|
||||
<!-- <field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>-->
|
||||
<!-- <field name="model">mrp.workcenter</field>-->
|
||||
<!-- <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <!– Desktop view –>-->
|
||||
<!-- <xpath expr="//div[@name='o_wo']" position="inside">-->
|
||||
<!-- <button class="btn btn-secondary fa fa-desktop" name="action_work_order" type="object"-->
|
||||
<!-- context="{'search_default_ready': 1, 'search_default_progress': 1, 'search_default_pending': 1, 'desktop_list_view': 1, 'search_default_workcenter_id': active_id}"-->
|
||||
<!-- title="Work orders" aria-label="Work orders"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- override to change the no content image -->
|
||||
<record id="mrp.action_work_orders" model="ir.actions.act_window">
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
没有工单要做!
|
||||
</p>
|
||||
<p>
|
||||
工作订单是作为制造订单的一部分执行的操作。
|
||||
工序在物料清单中定义或直接添加到制造订单中。
|
||||
</p>
|
||||
<p>
|
||||
使用工作台工作中心控制面板直接登记车间中的操作.
|
||||
平板电脑为您的工人提供工作表,并允许他们报废产品,跟踪时间,
|
||||
发起维护请求,执行质量测试等.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_workcenter_kanban_action1" model="ir.actions.act_window">
|
||||
<field name="name">工作中心看板</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrp.workcenter</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="mrp.mrp_workcenter_kanban"/>
|
||||
<field name="search_view_id" ref="mrp.view_mrp_workcenter_search"/>
|
||||
<field name="domain">[('users_ids','in',uid)]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
创建新的工作中心
|
||||
</p>
|
||||
<p>
|
||||
制造业务在工作中心处理。工作中心可以由
|
||||
工人和/或机器,它们用于成本核算、调度、产能规划等。
|
||||
它们可以通过配置菜单定义。
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_mrp_dashboard"
|
||||
name="工作中心看板"
|
||||
action="mrp_workcenter_kanban_action1"
|
||||
groups="mrp.group_mrp_routings"
|
||||
parent="mrp.menu_mrp_root"
|
||||
sequence="5"/>
|
||||
|
||||
<!-- MRP.WORKCENTER -->
|
||||
<record model="ir.ui.view" id="view_mrp_workcenter_form_inherit_sf">
|
||||
<field name="name">mrp.workcenter.form.inherit.sf</field>
|
||||
<field name="model">mrp.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="Equipment" name="equipment">
|
||||
<field name="equipment_ids" widget="many2many">
|
||||
<tree string="Equipments">
|
||||
<field name="name"/>
|
||||
<field name="technician_user_id"/>
|
||||
<field name="category_id"/>
|
||||
<field name="mtbf"/>
|
||||
<field name="mttr"/>
|
||||
<field name="estimated_next_failure" string="Est. Next Failure"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="users_ids" widget="many2many_tags" string="可操作用户"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='alternative_workcenter_ids']" position="after">
|
||||
<field name="machine_tool_id" domain="[('is_binding','=',False)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_workcenter_view_kanban_inherit_maintenance" model="ir.ui.view">
|
||||
<field name="name">mrp.workcenter.view.kanban.inherit.maintenance</field>
|
||||
<field name="model">mrp.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='plan_order']" position="after">
|
||||
<div>
|
||||
<a name="%(maintenance.hr_equipment_request_action)d" type="action">Maintenance</a>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- MRP.PRODUCTION -->
|
||||
<record id="mrp_production_view_form_inherit_maintenance" model="ir.ui.view">
|
||||
<field name="name">mrp.production.view.form.inherit.maintenance</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_cancel" position="before">
|
||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
||||
</button>
|
||||
<div name="button_box" position="inside">
|
||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||
context="{'search_default_production_id': active_id}">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="maintenance_count"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Maintenance</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
387
sf_manufacturing/views/mrp_workorder_view.xml
Normal file
387
sf_manufacturing/views/mrp_workorder_view.xml
Normal file
@@ -0,0 +1,387 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="view_mrp_production_workorder_tree_editable_inherit_sf">
|
||||
<field name="name">mrp.production.workorder.tree.editable.inherit.sf</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="before">
|
||||
<field name="sequence"/>
|
||||
<field name='user_permissions' invisible="1"/>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="processing_panel"/>
|
||||
</field>
|
||||
<field name="state" position="after">
|
||||
<field name="work_state"/>
|
||||
</field>
|
||||
<xpath expr="//button[@name='button_start']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||
('is_user_working', '!=', False),("user_permissions","=",False)]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [("user_permissions","=",False)]}</attribute>
|
||||
<attribute name="string">停工</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
|
||||
</xpath>
|
||||
<!-- <button name="button_start" type="object" string="Start" class="btn-success"-->
|
||||
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>-->
|
||||
<!-- <button name="button_pending" type="object" string="Pause" class="btn-warning"-->
|
||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>-->
|
||||
<!-- <button name="button_finish" type="object" string="Done" class="btn-success"-->
|
||||
<!-- 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="Block" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"-->
|
||||
<!-- attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"/>-->
|
||||
<!-- <button name="button_unblock" type="object" string="Unblock" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"-->
|
||||
<!-- attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>-->
|
||||
<!-- <button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"-->
|
||||
<!-- title="Open Work Order"/>-->
|
||||
<!-- edit='false' create = 'false'-->
|
||||
<tree position="attributes">
|
||||
<attribute name="multi_edit"></attribute>
|
||||
<attribute name="editable"></attribute>
|
||||
<attribute name="create">false</attribute>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="mrp_workorder_action_tablet">
|
||||
<field name="name">工单</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrp.workorder</field>
|
||||
<field name="view_mode">tree,kanban,form</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_editable_view')}),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')}) ]"/>
|
||||
<!-- <field name="target">fullscreen</field>-->
|
||||
<field name="target">current</field>
|
||||
<field name="domain">[('state', '!=', 'cancel')]</field>
|
||||
<field name="context">{'search_default_workcenter_id': active_id}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
没有工单要做!
|
||||
</p>
|
||||
<p>
|
||||
工作订单是作为制造订单的一部分执行的操作。
|
||||
工序在物料清单中定义或直接添加到制造订单中。
|
||||
</p>
|
||||
<p>
|
||||
使用工作台工作中心控制面板直接登记车间中的操作.
|
||||
平板电脑为您的工人提供工作表,并允许他们报废产品,跟踪时间,
|
||||
发起维护请求,执行质量测试等.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record model="ir.ui.view" id="view_mrp_production_workorder_form_inherit_sf">-->
|
||||
<!-- <field name="name">mrp.production.workorder.form.inherit.sf</field>-->
|
||||
<!-- <field name="model">mrp.workorder</field>-->
|
||||
<!-- <field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <field name="production_id" position="after">-->
|
||||
<!-- <field name="processing_panel" readonly="1"/>-->
|
||||
<!-- </field>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="view_mrp_production_workorder_tray_form_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">mrp.production.workorder.tray.form.inherit.sf</field>
|
||||
<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="//field[@name='state']" position="before">
|
||||
|
||||
<field name='user_permissions' invisible="1"/>
|
||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||
('is_user_working', '!=', False),('user_permissions','=',False)]}"/>
|
||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||
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="停工"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False)]}"/>
|
||||
<button name="button_unblock" type="object" string="Unblock"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
||||
</xpath>
|
||||
<!-- 隐藏物料清单-->
|
||||
<xpath expr="//page[@name='components']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<!-- 隐藏物料清单-->
|
||||
|
||||
<field name="production_id" position="after" invisible="0">
|
||||
<group>
|
||||
<field name="date_planned_start" invisible="1"/>
|
||||
<field name="date_planned_finished" invisible="1"/>
|
||||
<!-- <field name="production_id" readonly="1"/>-->
|
||||
<field name="duration" widget="mrp_timer"
|
||||
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
||||
sum="real duration"/>
|
||||
<field name="processing_panel" readonly="1" attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||
</group>
|
||||
|
||||
<!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',-->
|
||||
<!-- '前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>-->
|
||||
</field>
|
||||
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
|
||||
<group>
|
||||
<field name="programming_no" readonly="1"
|
||||
attrs='{"invisible": [("programming_no","=",False)]}'/>
|
||||
<field name="programming_state" readonly="1"
|
||||
attrs='{"invisible": [("programming_no","=",False)]}'/>
|
||||
</group>
|
||||
<group>
|
||||
<div class="col-12 col-lg-6 o_setting_box" style="white-space: nowrap">
|
||||
<button type="object" class="oe_highlight" name="fetchCNC" string="获取CNC程序代码"
|
||||
attrs='{"invisible": ["|", "|", ("state","!=","progress"),("user_permissions","=",False),("programming_no","!=",False)]}'/>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
<!-- <page string="Components" name="components">-->
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>
|
||||
<group>
|
||||
<field name="routing_type" invisible="1"/>
|
||||
<field name="tray_code"/>
|
||||
<field name="tray_id" readonly="1"/>
|
||||
|
||||
|
||||
</group>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="gettray" string="绑定托盘"
|
||||
attrs='{"invisible": ["|","|",("tray_id","!=",False),("state","!=","progress"),("production_id","=",False)]}'/>
|
||||
|
||||
</div>
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="前置三元检测定位参数" attrs='{"invisible": [("routing_type","!=","前置三元定位检测")]}'>
|
||||
|
||||
<div>左面:</div>
|
||||
<div class="o_address_format">
|
||||
<label for="X1_axis" string="x"/>
|
||||
<field name="X1_axis" class="o_form_label"
|
||||
decoration-success="X1_axis > 0"
|
||||
decoration-warning="X1_axis < 0"/>
|
||||
<label for="Y1_axis" string="y"/>
|
||||
<field name="Y1_axis" class="o_form_label"
|
||||
decoration-success="Y1_axis > 0"
|
||||
decoration-warning="Y1_axis < 0"/>
|
||||
<label for="Z1_axis" string="z"/>
|
||||
<field name="Z1_axis" class="o_form_label"
|
||||
decoration-success="Z1_axis > 0"
|
||||
decoration-warning="Z1_axis < 0"/>
|
||||
<div></div>
|
||||
<label for="X2_axis" string="x"/>
|
||||
<field name="X2_axis" class="o_form_label"
|
||||
decoration-success="X2_axis > 0"
|
||||
decoration-warning="X2_axis < 0"/>
|
||||
<label for="Y2_axis" string="y"/>
|
||||
<field name="Y2_axis" class="o_form_label"
|
||||
decoration-success="Y2_axis > 0"
|
||||
decoration-warning="Y2_axis < 0"/>
|
||||
<label for="Z2_axis" string="z"/>
|
||||
<field name="Z2_axis" class="o_form_label"
|
||||
decoration-success="Z2_axis > 0"
|
||||
decoration-warning="Z2_axis < 0"/>
|
||||
</div>
|
||||
<div>前面:</div>
|
||||
<div class="o_address_format">
|
||||
<label for="X3_axis" string="x"/>
|
||||
<field name="X3_axis" class="o_form_label"
|
||||
decoration-success="X3_axis > 0"
|
||||
decoration-warning="X3_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y3_axis" string="y"/>
|
||||
<field name="Y3_axis" class="o_form_label"
|
||||
decoration-success="Y3_axis > 0"
|
||||
decoration-warning="Y3_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z3_axis" string="z"/>
|
||||
<field name="Z3_axis" class="o_form_label"
|
||||
decoration-success="Z3_axis > 0"
|
||||
decoration-warning="Z3_axis < 0"/>
|
||||
<div></div>
|
||||
<label for="X4_axis" string="x"/>
|
||||
<field name="X4_axis" class="o_form_label"
|
||||
decoration-success="X4_axis > 0"
|
||||
decoration-warning="X4_axis < 0"
|
||||
/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y4_axis" string="y"/>
|
||||
<field name="Y4_axis" class="o_form_label"
|
||||
decoration-success="Y4_axis > 0"
|
||||
decoration-warning="Y4_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z4_axis" string="z"/>
|
||||
<field name="Z4_axis" class="o_form_label"
|
||||
decoration-success="Z4_axis > 0"
|
||||
decoration-warning="Z4_axis < 0"/>
|
||||
</div>
|
||||
<div>右面:</div>
|
||||
<div class="o_address_format">
|
||||
<label for="X5_axis" string="x"/>
|
||||
<field name="X5_axis" class="o_form_label"
|
||||
decoration-success="X5_axis > 0"
|
||||
decoration-warning="X5_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y5_axis" string="y"/>
|
||||
<field name="Y5_axis" class="o_form_label" decoration-success="Y5_axis > 0"
|
||||
decoration-warning="Y5_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z5_axis" string="z"/>
|
||||
<field name="Z5_axis" class="o_form_label" decoration-success="Z5_axis > 0"
|
||||
decoration-warning="Z5_axis < 0"/>
|
||||
<div></div>
|
||||
<label for="X6_axis" string="x"/>
|
||||
<field name="X6_axis" class="o_form_label" decoration-success="X6_axis > 0"
|
||||
decoration-warning="X6_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y6_axis" string="y"/>
|
||||
<field name="Y6_axis" class="o_form_label" decoration-success="Y6_axis > 0"
|
||||
decoration-warning="Y6_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z6_axis" string="z"/>
|
||||
<field name="Z6_axis" class="o_form_label" decoration-success="Z6_axis > 0"
|
||||
decoration-warning="Z6_axis < 0"/>
|
||||
</div>
|
||||
<div>后面:</div>
|
||||
<div class="o_address_format">
|
||||
<label for="X7_axis" string="x"/>
|
||||
<field name="X7_axis" class="o_form_label" decoration-success="X7_axis > 0"
|
||||
decoration-warning="X7_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y7_axis" string="y"/>
|
||||
<field name="Y7_axis" class="o_form_label" decoration-success="Y7_axis > 0"
|
||||
decoration-warning="Y7_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z7_axis" string="z"/>
|
||||
<field name="Z7_axis" class="o_form_label" decoration-success="Z7_axis > 0"
|
||||
decoration-warning="Z7_axis < 0"/>
|
||||
<div></div>
|
||||
<label for="X8_axis" string="x"/>
|
||||
<field name="X8_axis" class="o_form_label" decoration-success="X8_axis > 0"
|
||||
decoration-warning="X8_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y8_axis" string="y"/>
|
||||
<field name="Y8_axis" class="o_form_label" decoration-success="Y8_axis > 0"
|
||||
decoration-warning="Y8_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z8_axis" string="z"/>
|
||||
<field name="Z8_axis" class="o_form_label" decoration-success="Z8_axis > 0"
|
||||
decoration-warning="Z8_axis < 0"/>
|
||||
</div>
|
||||
<div>上面:</div>
|
||||
<div class="o_address_format">
|
||||
<label for="X9_axis" string="x"/>
|
||||
<field name="X9_axis" class="o_form_label" decoration-success="X9_axis > 0"
|
||||
decoration-warning="X9_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y9_axis" string="y"/>
|
||||
<field name="Y9_axis" class="o_form_label" decoration-success="Y9_axis > 0"
|
||||
decoration-warning="Y9_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z9_axis" string="z"/>
|
||||
<field name="Z9_axis" class="o_form_label" decoration-success="Z9_axis > 0"
|
||||
decoration-warning="Z9_axis < 0"/>
|
||||
<div></div>
|
||||
<label for="X10_axis" string="x"/>
|
||||
<field name="X10_axis" class="o_form_label" decoration-success="X10_axis > 0"
|
||||
decoration-warning="X10_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Y10_axis" string="y"/>
|
||||
<field name="Y10_axis" class="o_form_label" decoration-success="Y10_axis > 0"
|
||||
decoration-warning="Y10_axis < 0"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="Z10_axis" string="z"/>
|
||||
<field name="Z10_axis" class="o_form_label" decoration-success="Z10_axis > 0"
|
||||
decoration-warning="Z10_axis < 0"/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="getcenter" string="计算定位"
|
||||
attrs='{"invisible": ["|","|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False)]}'/>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<field name="material_center_point"/>
|
||||
<field name='X_deviation_angle'/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="CNC程序" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<field name="cnc_ids" widget="one2many" string="工作程序">
|
||||
<tree decoration-success="button_state" decoration-bf="button_state">
|
||||
<field name="sequence_number"/>
|
||||
<field name="program_name"/>
|
||||
<field name="cnc_id" string="文件"/>
|
||||
<field name="cutting_tool_name"/>
|
||||
<field name="cutting_tool_no"/>
|
||||
<field name="processing_type"/>
|
||||
<field name="margin_x_y"/>
|
||||
<field name="margin_z"/>
|
||||
<field name="depth_of_processing_z"/>
|
||||
<field name="cutting_tool_extension_length"/>
|
||||
<field name="cutting_tool_handle_type"/>
|
||||
<field name="estimated_processing_time"/>
|
||||
<field name="remark"/>
|
||||
<field name="button_state" invisible="1"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
<group>
|
||||
<field name="cnc_worksheet" string="工作指令" widget="pdf_viewer"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<field name="results" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","后置三元质量检测")]}'>
|
||||
<group>
|
||||
<field name="test_results" widget="selection" attrs='{"invisible":[("results","!=",False)]}'/>
|
||||
<field name="results" readonly="1" attrs='{"invisible":[("results","!=","合格")]}'/>
|
||||
</group>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="recreateManufacturingOrWorkerOrder"
|
||||
string="检测确认"
|
||||
attrs='{"invisible": ["|","|",("state","!=","progress"),("user_permissions","=",False),("results","=","合格")]}'/>
|
||||
</div>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
||||
<field name="tray_id" readonly="1"/>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"
|
||||
attrs='{"invisible": ["|","|",("tray_id","=",False),("state","!=","progress"),("user_permissions","=",False)]}'/>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="action" class="oe_highlight" name="sf_manufacturing.label_sf_tray_code1"
|
||||
string="打印标签"
|
||||
attrs='{"invisible": ["|",("state","!=","progress"),("user_permissions","=",False)]}'/>
|
||||
</div>
|
||||
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
31
sf_manufacturing/views/tray_view.xml
Normal file
31
sf_manufacturing/views/tray_view.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="sf_tray_form_inherit" model="ir.ui.view">
|
||||
<field name="name">托盘条形码生成</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="inherit_id" ref="sf_base.sf_tray_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='group1']" position="after">
|
||||
<notebook>
|
||||
<page string="生成条形码">
|
||||
<field name='qr_image' widget="image"/>
|
||||
<group>
|
||||
<field name='production_id' readonly="1"
|
||||
attrs='{"invisible": [("production_id","=",False)]}'/>
|
||||
<field name="workorder_id"/>
|
||||
</group>
|
||||
<div class="col
|
||||
-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="unclamp" string="解除装夹"
|
||||
attrs='{"invisible": [("state","=","空闲")]}'/>
|
||||
</div>
|
||||
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user