Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/新增工件装夹
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
'views/maintenance_logs_views.xml',
|
||||
'views/equipment_maintenance_standards_views.xml',
|
||||
'views/maintenance_request_views.xml',
|
||||
'views/production_line_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
from . import sf_maintenance
|
||||
from . import sf_maintenance_logs
|
||||
from . import sf_equipment_maintenance_standards
|
||||
from . import sf_maintenance_requests
|
||||
from . import sf_maintenance_requests
|
||||
from . import production_line_base
|
||||
|
||||
30
sf_maintenance/models/production_line_base.py
Normal file
30
sf_maintenance/models/production_line_base.py
Normal file
@@ -0,0 +1,30 @@
|
||||
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('备注')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,4 +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
|
||||
|
||||
|
||||
|
||||
|
81
sf_maintenance/views/production_line_view.xml
Normal file
81
sf_maintenance/views/production_line_view.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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