Hello,
how can I get URL parameters eg. the id
in this image programmatically:
I need it for a module. The id is not passed in context so I'm trying this way now...
Thank you very much.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
how can I get URL parameters eg. the id
in this image programmatically:
I need it for a module. The id is not passed in context so I'm trying this way now...
Thank you very much.
The ID is one a paramater that you can find everywhere you want. It's passed as parameter to every function. Where you need of it?
I need it here: _columns = { 'stock_real': fields.function(nfx_product_value, type='float', string='Real Stock', multi="product"), }
def nfx_product_value(self, cr, uid, ids, field_names, arg, context=None): need id of product here... (ids has stock_location_ids only...)
def nfx_product_value(self, cr, uid, ids <--- this is a list with all the id..if there is only 1 id, you can take it with ids[0]
no, ids is a list with stock_location ids. I need the product id in this function and the location ids...
What file and what line have you this code? So I can read it, too..
self made module. you can see part of it here: http://help.openerp.com/question/8598/how-can-i-pass-context-to-a-one2many-field/
function test is called and returns location ids. this location ids are passed to the fields complete_name, stock_real and stock_virtual
If I don't know all the code and the context when is it inserted I can't help you...I'm sorry
to calculate the real_stock of the product, I need the id of the location and the product too...
ok, thank you. that's why I want the id from the url... :-(
If you print the context, can you see the product_id?
no, the product_id is not in the context. I tried add it manually with <field name="stock_real" context="{'product_id': 49}"/> but it don't works.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
System redirect to a wrong url
Đã xử lý
|
|
1
thg 5 25
|
732 | |
|
0
thg 11 24
|
1383 | ||
|
0
thg 3 24
|
1382 | ||
Unable to Delete Company Parameter
Đã xử lý
|
|
1
thg 5 24
|
2370 | |
|
1
thg 12 23
|
7136 |