Skip to Content
Menu
This question has been flagged
1 Reply
3419 Views

I my module I have an entity "Bill" with two float fields "total" and "remaining" I want "remaining" to take its default value from "total". How can I do that? I have tried these with but when I try to create a new "Bill" it shows an error "TypeError: float() argument must be a string or a number, not 'Float'"

total = fields.Float(string='Total', digits=(10, 2))

remaining = fields.Float(string='Remaining', digits=(10, 2) default=total)

Avatar
Discard
Best Answer

total = fields.Float(string='Total', digits=(10, 2))

remaining = fields.Float(string='Remaining', digits=(10, 2) ,related='total',store=True)

:)

 

Avatar
Discard