0

I am using odoo 10.

My xml:

<odoo>

    <template id="assets_backend" name="web_lead_funnel_chart_assets" inherit_id="web.assets_backend">

        <xpath expr="." position="inside">

            <script type="text/javascript" src="/sales_chart/static/src/lib/highcharts.js"/>

            <script type="text/javascript" src="/sales_chart/static/src/lib/highcharts-3d.js"/>

            <script type="text/javascript" src="/sales_chart/static/src/js/web_lead_funnel_chart.js"/>

        </xpath>

    </template>



    <!-- Action for Funnel Chart -->

    <record id="action_highcharts-3d" model="ir.actions.client">

        <field name="name">Majors chart</field>

        <field name="tag">sales_chart.highcharts-3d</field>

    </record>

    <menuitem id="FunnelChart" name="Budget Analysis" parent="budget_management.menu_graph"

        action="action_highcharts-3d" groups="sales_team.group_sale_manager" sequence="1"/>

    <!--<menuitem id="FunnelChart" name="Sales Analysis" parent="sales_team.menu_sales"

    action="action_funnel_chart" groups="sales_team.group_sale_manager"/>-->

</odoo>

Js file:

/global Highcharts/

odoo.define("sales_chart.sale_order_chart", function(require) {

    "use strict";



    var core = require("web.core");

    var dataset = require("web.data");

    var Widget = require("web.Widget");

    var WebClient = require('web.web_client');

    var Session = require('web.session');

    var _t = core._t;



    var highcharts3d = Widget.extend({

        template: "FunnelChart",

        start: function() {

            var self = this;

            self.crm_lead_dataset = new dataset.DataSetSearch(self, "crm.lead", {}, []);

            self.crm_lead_dataset.call("get_lead_stage_data", [

                []

            ]).done(function(callbacks) {

                self.CrmFunnelChart = Highcharts.chart("container",{

                chart: {

                    type: 'pie',

                    options3d: {

                        enabled: true,

                        alpha: 45,

                        beta: 0

                    }

                },

                title: {

                    text: 'Contents of Highsoft\'s weekly fruit delivery'

                },

                subtitle: {

                    text: '3D donut in Highcharts'

                },

                plotOptions: {

                    pie: {

                        innerSize: 100,

                        depth: 45

                    }

                },

                series: [{

                    name: 'Delivered amount',

                    data: [

                        ['Bananas', 8],

                        ['Kiwi', 3],

                        ['Mixed nuts', 1],

                        ['Oranges', 6],

                        ['Apples', 8],

                        ['Pears', 4],

                        ['Clementines', 4],

                        ['Reddish (bag)', 1],

                        ['Grapes (bunch)', 1]

                    ]

                }]

                });

            });

        },

    });



    core.action_registry.add("sales_chart.highcharts-3d", highcharts3d);



});

It works when I remove javasript link highcharts-3d.js (but it shows as pie chart not as 3d)

When I include the link I get this error: Could not find client action sales_chart.highcharts-3d

I am using Odoo v10 what im doing wrong here? Let me know if you need more details. thanks!

user3606682
  • 1,945
  • 3
  • 17
  • 24
  • Hi user3606682, you used 'highcharts' tag but the problem doesn't seem to be about a chart - rather about 'odoo'. Your chart options works correctly in a standard environment: https://jsfiddle.net/BlackLabel/oxnr34tc/ – ppotaczek Aug 16 '18 at 18:30
  • Yes Bro you are exactly right if I run it as html file the chart works fine as expected, but in odoo I face this problem – user3606682 Aug 17 '18 at 19:10

0 Answers0