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

In odoo 16, I have created a custom widget. I am getting error.

var CustomWidgetName = AbstractField.extend({
    FieldRegistry.add('CustomWidgetName', CustomWidgetName);
    return { 
      CustomWidgetName: CustomWidgetName, 
  }; 
});

In browser, I can see only the value of json field. But I need graph which I wrote in json file. And I am getting this message (Missing widget error) in browser console.

Missing widget: CustomWidgetName for field of type text

I used the created widget inside the kanban-box view.

/*?xml version="1.0" encoding="utf-8"?*/

/*odoo*/

/*record id="new_id" model="ir.ui.view"*/

/*field name="name"*/Dashboard/*field*/

/*field name="model"*/new.model.name/*field*/

/*field name="type"*/kanban/*field*/

/*field name="arch" type="xml"*/

/*kanban create="false"*/

/*templates*/

/*t t-name="kanban-box"*/

/*div class="card-body o_dashboard_graph" style="margin:auto;"*/

/*field name="json_value_field" ylabel="y" xlabel="x" graph_type="line" widget="CustomWidgetName"*/

/*/div*/

/*/t*/

/*/templates*/

/*/kanban*/

/*/field*/

/*/record*/

/*/odoo*/




Avatar
Zrušit
Nejlepší odpověď

Hi,

Please refer to the below blog to know how to create a field widget in odoo
https://www.cybrosys.com/blog/how-to-create-a-field-widget-in-the-odoo-16#:~:text=Now%20let%20us%20see%20How,it%20in%20a%20form%20view.


Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
bře 24
14
1
bře 24
2414
1
pro 22
4211
2
čvn 22
11743
1
úno 24
2835