0

In a custom widget, is the data of a field that we turned into widget available to be used inside the widget?

For example if I make a custom widget for a one2many field, when I display that field using XML like this

<field name="myfield" widget="mywidget"/>

Can we use the data of field myfield? In my case for iteration, for looping and making a custom widget for each items inside the field.

Is this possible?

I didn't see any example in the https://www.odoo.com/documentation/8.0/howtos/web.html

strike_noir
  • 4,080
  • 11
  • 57
  • 100

1 Answers1

0

Turns out the data is inside

self.field_manager.datarecord

You can use console.log to shows its content. You can also use it for coding your JavaScript.

strike_noir
  • 4,080
  • 11
  • 57
  • 100