前车之鉴,one2many的widget
- 
假如自己加了两个表进去,a对b是many2one,b对a是one2many,那么b的view里面如果要加入一个one2many的widget,那么必须在其后指定要使用的view。因为自己定义的表没有单独的view可用。系统找不到view就会出错。 举例说明: 
 表product.product:
 [code]
 _columns = {
 'tb_picture': fields.binary('图片'),
 'tb_dimension': fields.char('规格尺寸', size=100),
 'tb_material': fields.char('材质', size=100),
 'tb_itemid': fields.char('淘宝产品ID', size=100),
 'tb_description': fields.text('产品描述'),
 'tb_online': fields.boolean('上线'),
 'tb_onshelf': fields.boolean('上架'),
 'tb_synchronized': fields.boolean('已同步'),
 'tb_picture_urls': fields.one2many('product.picture.url', 'product_id', '图片地址'),
 }
 [/code]表product.picture.url: 
 [code] _columns = {
 'product_id': fields.many2one('product.product', '产品ID', select=1, ondelete='cascade', required=True),
 'picture_url': fields.char('图片地址', size=200),
 }
 [/code]表product.product的view里面要加one2many,就要这么写才能显示出来: 
 [code]
 <field name="tb_picture_urls" mode="tree" colspan="4" nolabel="1" >
 <tree string="图片地址">
 <field name="picture_url" />
 </tree>
 <form string="图片地址">
 <field name="picture_url" />
 </form>
 </field>
 [/code]另一个值得注意问题是:表名不能用大写。因为pqsql区分大小写,而openerp不区分大小写,所有的大写最后都变成小写了,就会导致找不到表,也会出错的。