hi i created a module it has two fields product and price. My need is to display the price in the price field when i select the product . Any one please give the corresponding code for this in python.. Thanks in advance...
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
First way :
- your price field can be fields.function(_get_price_from_product...) (read documentation about it)
- Add an on_change event in your module view on the product field (read also documentation about it)
- This on_change function can call directly the _get_price_from_product function to return the good price.
Second way :
- Your price field can be a fields.related('product_id', 'list_price', ...) (read doc)
- I think depending your version, it will be re-calculated automaticaly when product_id change (to check). Else Do the same as previous 2. and 3..
Last way :
- If you want to change price independently than the product price, price must be a fields.float()
- In on_change method of product field, change the price
Good luck
thank... for information.
i have made this but selcting product will cause an error like this........Client Traceback (most recent call last): File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\controllers\main.py", line 1129, in call_kw Server Traceback (most recent call last): File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\session.py", line 90, in send AttributeError: 'test_base' object has no attribute 'onchange_code'...
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
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 | |
---|---|---|---|---|
|
3
thg 10 23
|
6015 | ||
|
2
thg 1 23
|
5383 | ||
Datetime in python
Đã xử lý
|
|
7
thg 6 21
|
24687 | |
|
11
thg 9 19
|
38530 | ||
|
0
thg 5 16
|
3957 |