Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
7888 Zobrazení

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?

Avatar
Zrušit

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

Nejlepší odpověď

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.

Avatar
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit

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),

Related Posts Odpovědi Zobrazení Aktivita
1
zář 21
5611
4
pro 23
20909
2
dub 20
13316
0
dub 17
3485
1
zář 15
3877