Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/新增工件装夹
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'report/tray_report.xml',
|
||||
'views/mrp_maintenance_views.xml',
|
||||
# 'views/mrp_maintenance_views.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/mrp_workcenter_views.xml',
|
||||
'views/mrp_workorder_view.xml',
|
||||
|
||||
@@ -11,6 +11,8 @@ class MrpProduction(models.Model):
|
||||
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
|
||||
request_ids = fields.One2many('maintenance.request', 'production_id')
|
||||
model_file = fields.Binary('模型文件', related='product_id.model_file')
|
||||
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排')],
|
||||
string='排程状态', default='未排')
|
||||
|
||||
@api.depends('request_ids')
|
||||
def _compute_maintenance_count(self):
|
||||
@@ -336,7 +338,7 @@ class MrpProduction(models.Model):
|
||||
current_sequence += 1
|
||||
if work.name == '获取CNC加工程序':
|
||||
work.button_start()
|
||||
work.fetchCNC()
|
||||
#work.fetchCNC()
|
||||
|
||||
# 创建工单并进行排序
|
||||
def _create_workorder(self):
|
||||
|
||||
@@ -28,7 +28,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
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="型号")
|
||||
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
||||
workcenter_id = fields.Many2one('mrp.workcenter', string='工作中心', required=False)
|
||||
users_ids = fields.Many2many("res.users", 'users_workorder', related="workcenter_id.users_ids")
|
||||
processing_panel = fields.Char('加工面')
|
||||
sequence = fields.Integer(string='工序')
|
||||
@@ -106,6 +106,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
picking_in_id = fields.Many2one('stock.picking', string='外协入库单')
|
||||
picking_out_id = fields.Many2one('stock.picking', string='外协出库单')
|
||||
supplier_id = fields.Many2one('res.partner', string='外协供应商')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', string='加工设备')
|
||||
schedule_state = fields.Selection(related='production_id.schedule_state', store=True)
|
||||
|
||||
def get_no_data(self, production_id):
|
||||
process_parameter_workorder = self.search(
|
||||
@@ -165,7 +167,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'operation_id': False,
|
||||
'name': route.route_workcenter_id.name,
|
||||
'processing_panel': k,
|
||||
'quality_point_ids':route.route_workcenter_id.quality_point_ids,
|
||||
'quality_point_ids': route.route_workcenter_id.quality_point_ids,
|
||||
'routing_type': route.routing_type,
|
||||
'work_state': '' if not route.routing_type == '获取CNC加工程序' else '待发起',
|
||||
'workcenter_id': self.env['mrp.routing.workcenter'].get_workcenter(route.workcenter_ids.ids,
|
||||
|
||||
@@ -231,18 +231,8 @@ class ProductionLot(models.Model):
|
||||
1]
|
||||
now = datetime.now().strftime("%Y-%m-%d")
|
||||
# formatted_date = now.strftime("%Y-%m-%d")
|
||||
if product.integral_cutting_tool_type_id:
|
||||
return "%s-%s-%03d" % (product.integral_cutting_tool_type_id.code, now, 1)
|
||||
if product.blade_type_id:
|
||||
return "%s-%s-%03d" % (product.blade_type_id.code, now, 1)
|
||||
if product.cutter_bar_type_id:
|
||||
return "%s-%s-%03d" % (product.cutter_bar_type_id.code, now, 1)
|
||||
if product.cutter_pad_type_id:
|
||||
return "%s-%s-%03d" % (product.cutter_pad_type_id.code, now, 1)
|
||||
if product.handle_type_id:
|
||||
return "%s-%s-%03d" % (product.handle_type_id.code, now, 1)
|
||||
if product.chuck_type_id:
|
||||
return "%s-%s-%03d" % (product.chuck_type_id.code, now, 1)
|
||||
if product.cutting_tool_model_id:
|
||||
return "%s-%s-%03d" % (product.cutting_tool_model_id.code, now, 1)
|
||||
return "%s-%03d" % (product.name, 1)
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="replace">
|
||||
<field name="is_subcontract" invisible="1"/>
|
||||
|
||||
<field name="name" decoration-success="is_subcontract" decoration-bf="is_subcontract"/>
|
||||
</field>
|
||||
<field name="name" position="before">
|
||||
<field name="schedule_state"/>
|
||||
<field name="sequence"/>
|
||||
<field name='user_permissions' invisible="1"/>
|
||||
</field>
|
||||
@@ -19,6 +21,9 @@
|
||||
<field name="state" position="after">
|
||||
<field name="work_state" optional="hide"/>
|
||||
</field>
|
||||
<field name="product_id" position="after">
|
||||
<field name="equipment_id" optional="hide"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='date_planned_start']" position="replace">
|
||||
<field name="date_planned_start" string="计划开始日期" optional="show"/>
|
||||
</xpath>
|
||||
@@ -73,7 +78,7 @@
|
||||
(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="domain">[('state', '!=', 'cancel'),('schedule_state', '=', '已排')]</field>
|
||||
<field name="context">{'search_default_workcenter_id': active_id}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
@@ -91,6 +96,28 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="mrp_workorder_action_scheduled">
|
||||
<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_id" ref="view_mrp_production_workorder_tree_editable_inherit_sf"/>
|
||||
|
||||
<!-- <field name="view_ids" eval="[(5, 0, 0),-->
|
||||
<!-- (0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_view')}),-->
|
||||
<!-- (0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')}) ]"/>-->
|
||||
<!-- <field name="target">fullscreen</field>-->
|
||||
<!-- <field name="search_view_id" ref="mrp.view_mrp_production_workorder_form_view_filter"/>-->
|
||||
<!-- <field name="domain">[('state', '!=', 'cancel'),('schedule_state', '=', '已排')]</field>-->
|
||||
<!-- <field name="context">{'search_default_workcenter_id': active_id}</field>-->
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_workorder">
|
||||
没有已排程的工单!
|
||||
</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>-->
|
||||
@@ -126,9 +153,9 @@
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/>
|
||||
</xpath>
|
||||
<!-- 隐藏物料清单-->
|
||||
<!-- <xpath expr="//page[@name='components']" position="attributes">-->
|
||||
<!-- <attribute name="invisible">1</attribute>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//page[@name='components']" position="attributes">-->
|
||||
<!-- <attribute name="invisible">1</attribute>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- 隐藏物料清单-->
|
||||
|
||||
<field name="production_id" position="after" invisible="0">
|
||||
@@ -141,6 +168,9 @@
|
||||
sum="real duration"/>
|
||||
<field name="processing_panel" readonly="1"
|
||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||
<field name="equipment_id"
|
||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||
|
||||
</group>
|
||||
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
|
||||
<div>
|
||||
@@ -165,7 +195,7 @@
|
||||
<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程序代码"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user