我最初为 openerp 6.1 制作了一个自定义模块,我想使用最新的 openerp 7 版本将它安装在我得到的另一台 openerp 服务器上。
我已经做了“更新模块列表”并搜索了“额外”和“未安装”过滤器,但没有成功。
我在某处读到 openerp 6.1 模块在 openerp 7 上并不完全相同
有人可以对此有所了解吗?目前关于 openerp 7 上的自定义模块的文档也很差。
这是我的__init__.py
import schoolsout
__openerp__.py
{
"name" : "Student Information",
"version" : "6.0.1",
"author" : "Koci",
"website" : "http://www.tuespacioweb.com.ve",
"category" : "General",
"depends" : ["base"],
"description" : "Certificados de NO Produccion Grafibond",
"init_xml" : [],
"demo xml" : [],
"update_xml" : [ "schoolsout_view.xml"],
"installable": True,
"active": False,
"certificate" : ""
}
schoolsout.py
from openerp.osv import fields, orm
class student(orm.Model):
_name = 'student.student'
_columns = {
'name' : fields.char('Student Name', size=16, required = True, translate=True),
'age' : fields.integer('Age',readonly = True),
'percent' : fields.float('Percentage',help = 'This field will add average marks of student out of 100.'),
'gender' : fields.selection([('male','Male'),('female','Female')],'Gender'),
'active' : fields.boolean('Active'),
'notes' : fields.text('Details'),
}
_defaults = { 'name' : 'Atul',
'active' : True,
}
学生_学生()
最后是schoolout_view.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Student search view -->
<record model="ir.ui.view" id="student_search">
<field name="name">student.search</field>
<field name="model">student.student</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Student Information Search" version="7.0">
<field name="name" string="Student Name" />
<field name="gender" string="Gender" />
<field name="age" string="Age" />
</search>
</field>
</record>
<!-- Student tree view -->
<record id="student_student_tree" model="ir.ui.view">
<field name="name">student.result.tree.new</field>
<field name="model">student.student</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Student_result" version="7.0">
<field name="name" />
<field name="age" />
<field name="percent" />
<field name="gender" />
<field name="active" />
</tree>
</field>
</record>
<!--Student Form View-->
<record id="student_student_form" model="ir.ui.view">
<field name="name">student.result.form</field>
<field name="model">student.student</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Student_result" version="7.0">
<field name="name" />
<field name="age" />
<field name="percent" />
<field name="gender" />
<field name="active" />
<field name="notes" />
</form>
</field>
</record>
<!-- Student Action-->
<record id="action_student_student" model="ir.actions.act_window">
<field name="name">Student Information</field>
<field name="res_model">student.student</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!--Student Menu-->
<menuitem id="student_parent" name="Student" icon="terp-partner"/>
<menuitem id="menu_student_parent" name="Student Management" parent="student_parent"></menuitem>
<menuitem action="action_student_student" id="menu_student_student" parent="menu_student_parent" string="Result"/>
</data>
任何建议将不胜感激,非常感谢