代码终版
This commit is contained in:
@@ -14,13 +14,14 @@
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'report/tray_report.xml',
|
||||
'views/mrp_maintenance_views.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/mrp_workcenter_views.xml',
|
||||
'views/mrp_workorder_view.xml',
|
||||
'views/mrp_workcenter_views.xml',
|
||||
'views/tray_view.xml',
|
||||
'views/model_type_view.xml',
|
||||
'report/tray_report.xml'
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -16,10 +16,10 @@ class ResWorkcenter(models.Model):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("sf_manufacturing.mrp_workorder_action_tablet")
|
||||
return action
|
||||
else:
|
||||
return super(MrpWorkcenter, self).action_work_order()
|
||||
return super(ResWorkcenter, self).action_work_order()
|
||||
|
||||
def _get_unavailability_intervals(self, start_datetime, end_datetime):
|
||||
res = super(MrpWorkcenter, self)._get_unavailability_intervals(start_datetime, end_datetime)
|
||||
res = super(ResWorkcenter, self)._get_unavailability_intervals(start_datetime, end_datetime)
|
||||
if not self:
|
||||
return res
|
||||
sql = """
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
|
||||
|
||||
@@ -237,7 +239,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
if self.state == 'waiting':
|
||||
if self.state == 'waiting' or self.state == 'ready':
|
||||
self.ensure_one()
|
||||
if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)):
|
||||
return True
|
||||
|
||||
@@ -1,5 +1,64 @@
|
||||
<?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="Maintenance Request"/>
|
||||
</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">
|
||||
No work orders to do!
|
||||
</p><p>
|
||||
Work orders are operations to do as part of a manufacturing order.
|
||||
Operations are defined in the bill of materials or added in the manufacturing order directly.
|
||||
</p><p>
|
||||
Use the table work center control panel to register operations in the shop floor directly.
|
||||
The tablet provides worksheets for your workers and allow them to scrap products, track time,
|
||||
launch a maintenance request, perform quality tests, etc.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_mrp_dashboard"
|
||||
name="工作中心概述"
|
||||
action="mrp.mrp_workcenter_kanban_action"
|
||||
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>
|
||||
|
||||
@@ -247,8 +247,8 @@
|
||||
<button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"/>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<!-- <button type="action" class="oe_highlight" name="sf_manufacturing_orders.label_sf_tray_code1"-->
|
||||
<!-- string="打印标签"/>-->
|
||||
<button type="action" class="oe_highlight" name="sf_manufacturing.label_sf_tray_code1"
|
||||
string="打印标签"/>
|
||||
</div>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
Reference in New Issue
Block a user