请教大家,如何在销售订单子表上加字段?
-
公司是做瓦楞纸,openerp有些不适用,需求发过贴子 [检测到链接无效,已移除] br />
[b]init.py:[/b]
import wlz_order
[b]openerp.py:[/b]
# -- encoding:utf-8 --
{
"name" : "瓦楞纸行业",
"version" : "1.0",
"description" : '适用于瓦楞纸行业',
"depends" : ["sale"],
"init_xml" : [],
"update_xml" : ['wlz_order_view.xml'],
"installable" : True,
}
[b]wlz_order.py[/b]:
# -- coding: utf-8 --
#!/usr/bin/python
from osv import osv, fields
class sale_order_line(osv.osv):
_name = 'sale.order.line'
_inherit = 'sale.order.line'
_description = 'Sale Order Line'
_columns = {
'product_swgg':fields.char('实物规格',size=8),
'product_yjgg':fields.char('应计规格',size=8),
'product_zs':fields.integer('张数',size=5),
'product_mj':fields.float('面积',digits=(16,2))
}
sale_order_line()
[b]wlz_order_view.xml:[/b]
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_order_line_form">
<field name="name">wlz.order.line.form</field>
<field name="type">form</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_form2"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="product_swgg"/>
<field name="product_yjgg"/>
</field>
</field>
</record>
</data>
</openerp>