I have a custom field (on a view based on the object res.partner). It's not possible to edit the field size in Settings > Technical > Database Structure > Fields. I would like to change the length of this field. How can do it? Where can I find the related python script on my server?
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ờ
You can change the size of the char field in the XML-file :
<field name="my_field" style="font-size:13pt;"/>
The Temur's answer is for the number of characters.
field definitions are incremental. it means if you know what is the model this field belongs to, then you can inherit this model in your python code, add field with the same name and in field definition use the only attribute, the size. this way size will be changed, whereas all other properties will be preserved. say it's a Char field named "ex_field", then:
class my_model(models.Model): _inherit="parent.model" ex_field = fields.Char(size=256)
as noted above, ex_field is field you need to change size for.
I do not noticed v7 tag... but (size=NewSize) part should be same for openerp7 as well, just adapt the rest...
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 | |
---|---|---|---|---|
|
2
thg 3 24
|
11274 | ||
|
2
thg 8 21
|
13515 | ||
|
5
thg 8 20
|
7464 | ||
|
1
thg 12 19
|
5363 | ||
|
0
thg 9 17
|
3507 |