Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
23393 Lượt xem

I have just created a module and want to add two fields to product module using this code:

 <record id="product_product_template_only_form_view" model="ir.ui.view">
		<field name="model">product.product</field>
		<field name="inhert_id" ref="product.product_template_only_form_view" />
		<field name="arch" type="xml">
			<field name="list_price" position="after">
				<field name="boatlength" />
				<field name="fuelcapacity" />
			</field>
		</field>
	</record>

but I get this error: 

ParseError: "Wrong value for ir.ui.view.type: 'field'" while parsing file:///C:/Odoo/server/openerp/addons/boatcompany/boatcompany_view.xml:5,

I think it might have something to do with the default view in product.product module but I am not sure where.

This is the class I created:


from openerp.osv import fields, osv

class product_product(osv.osv):

_inhert = "product.product"

_columns = {

"boatlength": fields.char("Boat Length", size=10),

"fuelcapacity": fields.char("Fuel Capacity", size=10),

}


Is this the correct default view?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Siobhan your problem is in the following line:

<field name = "inhert_id" ref = "product.product_template_only_form_view" />

You misspelled the value in the name field. Change it for this:

name="inherit_id"

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 25
5
0
thg 3 25
1026
1
thg 1 25
1447
1
thg 5 22
2804
4
thg 12 23
23582