Hi everyone!
I need to get value from Database WITHOUT using SQL in python script.
I was tried to get parent_id field from model 'ir.ui.menu' and set a new value for this field, but unsuccessfully.
Can someone help me with this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
just use the ORM method write.
e.g:-
rec=self.env['ir.ui.menu'].browes(id) #browes take the record id
rec.parent_id=Value
or
rec.write({'parent_id':Value})
Thank you!
And, maybe you know, how to use this in class constructor?
I try to use this
db = sql_db.db_connect('main-db')
cr = db.cursor()
env = api.Environment(cr, SUPERUSER_ID, {})
model = env['ir.ui.menu'].browse(90)
print model.parent_id
And getting error 'ir.ui.menu' object has no attribute 'id'"
Now this code working with decorator '@api.onchange('field')', but I want execute him one time and without any actions on front-end (like changing 'field' like now)
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
มี.ค. 15
|
12393 | ||
|
2
เม.ย. 15
|
4259 | ||
|
1
มี.ค. 15
|
5762 | ||
|
1
มี.ค. 15
|
5130 | ||
|
1
มี.ค. 15
|
6189 |