Skip to content
Advertisement

Tag: widget

Get access to other elements from widget inside form view

Odoo 13. I got two float fields: time_given and timer. I have created a widget for ‘timer’ field. My widget works as real-time clock or some sort of timer. The problem I have encountered is that I want to change the style of ‘time_given’ field based on the following condition: ((time_given – timer) <= 30 sec) i.e less than 30

How to dynamically change Django Form field type (e.g. `forms.CharField` to `forms.ChoiceField`) without changing the data member variable?

TL;DR How can I change the search term CharField (of any of the rows in the image below) to another field type (e.g. ChoiceField, DateField, etc) based on the type of the selected database field (in the first select list on that row – see screenshot below)? Long version I have a cool hierarchical advanced search interface, e.g.: Each row

Get two properties at runtime and make combination of those two properties in string (orderby orderdirection)

I have two properties “orderby” and “orderdirection” in widget. In runtime I can adjust those properties check snip : I want to set these properties in my rest api query. eg: Query = “/_api/web/lists/getbytitle(‘” + listname + “‘)/items?&”$select=ID,Title,Date&$orderby=Title desc,Date asc” Above values are hardcoded but I want to change those values in runtime. When I want to update just one

Advertisement