Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3008 Lượt xem

The project name field can be translated, which doesn't make sense and is a pain to manage...

I tried to turn off by overriding the property through a custom module and that works, but all the project names are now json objects and doesn't seem possible to save them back as text.

How could I do this?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

try this way:

#inherit the model

from odoo import fields, models 
​classMyModel(models.Model): 
​​_inherit = 'base.model'# Replace 'base.model' with the actual model you want to inherit

​field_name = fields.Char(string='Field Name', translate=False)

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi, thanks for the feedback!
That's what I did; but the field already has many entries with values that are not the same between the languages; Odoo isn't t "dropping" one of them, it's showing both in json format in some views; other views just show "[object object]" and the data can't be updated due to some sql error trying to update a json column...

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 22
3449
3
thg 7 25
2330
3
thg 5 25
4075
2
thg 6 25
4532
0
thg 3 22
105