Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/订单计划
# Conflicts: # sf_maintenance/__manifest__.py # sf_manufacturing/views/mrp_workcenter_views.xml
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/production_line_view.xml',
|
||||
'views/maintenance_views.xml',
|
||||
'views/maintenance_logs_views.xml',
|
||||
'views/equipment_maintenance_standards_views.xml',
|
||||
|
||||
@@ -3,4 +3,3 @@ from . import sf_maintenance
|
||||
from . import sf_maintenance_logs
|
||||
from . import sf_equipment_maintenance_standards
|
||||
from . import sf_maintenance_requests
|
||||
from . import production_line_base
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
from odoo import models,fields
|
||||
|
||||
|
||||
class ProductionLine(models.Model):
|
||||
_name = 'sf.production.line'
|
||||
_description = '生产线'
|
||||
|
||||
def _get_code(self):
|
||||
"""
|
||||
自动生成编码
|
||||
:return:
|
||||
"""
|
||||
fixture_material = self.env['sf.production.line'].sudo().search(
|
||||
[('code', '!=', '')],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not fixture_material:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(fixture_material.code) + 1
|
||||
num = "%03d" % m
|
||||
return num
|
||||
|
||||
name = fields.Char('生产线')
|
||||
code = fields.Char('编码', default=_get_code, readonly=True)
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
MTcode = fields.Char("编码", default=get_no)
|
||||
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
equipment_type = fields.Selection([('机床', '机床')], related='category_id.equipment_type')
|
||||
code = fields.Char('行业编码')
|
||||
code = fields.Char('机台号')
|
||||
name = fields.Char('名称')
|
||||
knife_type = fields.Selection(
|
||||
[("BT40", "BT40"), ("BT30", "BT30")],
|
||||
@@ -144,7 +144,16 @@ class SfMaintenanceEquipment(models.Model):
|
||||
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||
string="控制系统")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
for parameter in self:
|
||||
if parameter.code:
|
||||
name = parameter.name + '-' + parameter.code
|
||||
else:
|
||||
name = parameter.name
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
|
||||
@api.constrains('rotate_speed')
|
||||
def _check_rotate_speed(self):
|
||||
|
||||
@@ -4,6 +4,6 @@ access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,base.gr
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,base.group_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_production_line,sf.production.line,model_sf_production_line,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,81 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="sf_production_line_tree" model="ir.ui.view">
|
||||
<field name="name">生产线</field>
|
||||
<field name="model">sf.production.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="生产线">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_production_line_form" model="ir.ui.view">
|
||||
<field name="name">生产线</field>
|
||||
<field name="model">sf.production.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="生产线">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_production_line_search" model="ir.ui.view">
|
||||
<field name="name">生产线</field>
|
||||
<field name="model">sf.production.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_production_line_kanban" model="ir.ui.view">
|
||||
<field name="name">生产线看板</field>
|
||||
<field name="model">sf.production.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="name"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<!-- 在这里定义每个卡片的内容 -->
|
||||
<div>
|
||||
<strong><field name="code"/></strong>
|
||||
<br/>
|
||||
<span><field name="name"/></span>
|
||||
<br/>
|
||||
<span><field name="remark"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_production_line_act" model="ir.actions.act_window">
|
||||
<field name="name">生产线</field>
|
||||
<field name="res_model">sf.production.line</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_sf_production_line"
|
||||
parent="sf_base.menu_sf_base"
|
||||
name="生产线"
|
||||
sequence="20"
|
||||
action="sf_production_line_act"/>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user