Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
5343 มุมมอง

Hi, when i try to inherit product.product it shows me ana error: ProgrammingError: column product_product.name does not exist LINE 1: SELECT product_product."name",product_product."price",produc...

my code is: class cloud_meter(osv.osv): _name = 'cloud.meter' _inherit ="product.product" _columns = { 'name' : fields.char("Meter Name",size=64,required=True), 'unit': fields.selection((('image','image'),('instance','instance'), ('B','B'),('MB','MegaByte'),('GB','GegaByte'),('packets','packets'),('%','Percentage'),('vcpu','Nomber of VSCPUs'),('Network','network'),('IP','Ip adresses')),"Unit",required=True, select=True), 'price':fields.char("Price",size=64), 'type': fields.selection((('image','image'),('gauge','gauge'), ('cumulative','cumulative'),('delta','delta')),"Type",required=True, select=True), 'project':fields.many2one('res.partner','project'), 'ressource':fields.many2one('cloud.resource','ressource'), 'statistic':fields.one2many('cloud.statistic','meter',string='Statistics'), 'invoice_ids': fields.many2many( 'account.invoice', 'relation_table_invoice_meter', 'id_meter', 'id_invoice', string="Invoices" ),

}

_rec_name = 'name'

cloud_meter()

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,The field 'unit' and 'type' which's required=True,In your code,you haven't set the defualt to them like:

 _defaults = { 'Unit': 'image'....

so the exist product records have null field 'unit' and 'type' Hope it will help you

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try to install this module in newly created database

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Maybe, you've made some changes in your file after install and did not restart the server.

You can also try without restart by deleting the .pyc filles from your module and reinstall.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
18
มี.ค. 16
48856
2
ก.ย. 25
511
1
ต.ค. 25
650
2
มิ.ย. 25
2179
0
มี.ค. 25
2049