跳至内容
菜单
此问题已终结

I have a function on_change in a Treeview (editable="bottom"):

Example:

Product Name | Qty.(onchange) | Unit Cost(onchange) | Total (readonly)

Product1 | 3.00 | 512.00 | 1536.00

*The problem is when i try to save after on_change, the field [Total] which is a readonly gets cleared/disappear. Just found out that when you set it to readonly=False the value of [Total] remains.

*Is there any method to lock the field rather than setting it to readonly=True? *Or it's still a bug from OpenERP 6.1?

形象
丢弃

You can inherit create and write methods to save the value on Total

最佳答案

As far as I know readonly fields are not sent to server. You may set an invisible field with the correct value and a related field to display readonly value.

形象
丢弃
编写者 最佳答案

Thanks nbessi, now I know somehow its a bug from 6.1

形象
丢弃

I also want to know using related field how to use in same table ? Example: fields.related(?, 'total', type='float', relation='current.table', string='Total', store=True),

相关帖文 回复 查看 活动
1
9月 21
5585
4
12月 23
20881
2
4月 20
13289
0
4月 17
3476
1
9月 15
3866