I can get the python shell with `odoo shell -d dbname` and I know what method I'd like to run on an instance but how do I get the instance of a model, please? It is a purchase order, in my case. I'm not an Odoo developer. I'm a JavaScript developer. I know a little python and I can read documentation but I couldn't figure it out from the docs and I don't intend on learning Odoo development. I'm looking to solve an issue, anecdotally.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
6177
Tampilan
purchase_order = env['purchase.order'].search([('name', '=', 'PO00001')], limit=1)
print purchase_order.name
print purchase_order.partner_id.name
print purchase_order.amount_total
print purchase_order.id
purchase_order_lines = env['purchase.order.line'].search([('order_id','=',purchase_order.id)])
for line in purchase_order_lines:
print str(line.product_qty) + ' - ' + line.product_id.name + ' - ' + str(line.price_unit)
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
2
Jul 24
|
14956 | ||
|
2
Sep 23
|
7954 | ||
|
1
Jul 23
|
1794 | ||
|
1
Nov 21
|
5324 | ||
ProgrammingError: can't adapt type 'NewId'
Diselesaikan
|
|
1
Apr 20
|
9679 |