Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
9493 Переглядів

I have a field in a module:

payment_amount_overdue = fields.Float(

compute='_get_amounts_and_date',

string="Amount Overdue",

store = False,

)


This field is not stored, so it's not searchable.

How can I make a related field to this field , to store the values in the database?

I tried with this, but this is not working:

payment_amount_due_store = fields.Float(related='partner_id.payment_amount_overdue', string="TEST", store=True)


Thank you for your help.








Аватар
Відмінити
Найкраща відповідь

payment_amount_overdue field is not store, due to that reason you are getting this issue.

If your requirement is search field then you can use search option in field.

payment_amount_overdue = fields.Float(compute='_get_amounts_and_date',search='_search_method',string="Amount Overdue",store = False)

def _search_method(self,operator,value):

     return [('id','in',ids)]

You can create search method and write logic in that method and return ids.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лист. 17
7383
1
трав. 17
3444
9
трав. 20
8181
7
жовт. 18
10401
0
трав. 17
2915