Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2082 Weergaven


I want to make a new button here.


I already make the element and the js function

        <?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="DoGanttView.buttons" t-extend="GanttView.buttons">
        <p>asdpoasidpaisdpaisd</p>
        <t t-jquery="*[hasclass='o_gantt_range']" t-operation="after">
            <button class="o_gantt_button_move_plan btn btn-primary" title="Move Button" data-hotkey="c">
                New Button
            </button>
        </t>
    </t>
</templates>

gantt_controller.js

/** @odoo-module alias=do_web_gantt.GanttController **/

import GanttController from 'web_gantt.GanttController';
import {_t} from 'web.core';
import { ControllerMixin } from './mixins';

const DoGanttController = GanttController.extend(ControllerMixin, {
    events: _.extend({}, GanttController.prototype.events, {
        'click .o_gantt_button_move_plan': '_onMovePlanClick',
    }),
    buttonTemplateName: 'DoGanttView.buttons',
});

export default DoGanttController;

gantt_view.js

/** @odoo-module alias=do_web_gantt.GanttView */
import DoGanttController from 'do_web_gantt.GanttController';
import view_registry from 'web.view_registry';
import GanttView from 'web_gantt.GanttView';

console.log('GanttView loaded');
const MassGanttView = GanttView.extend({
    config: Object.assign({}, GanttView.prototype.config, {
        Controller: DoGanttController,
    })
});
view_registry.add('do_gantt', MassGanttView);
export default MassGanttView;





manifest

    'assets': {
        'web._assets_primary_variables': [
            'do_web_gantt/static/src/scss/web_gantt.variables.scss',
        ],
        'web.assets_backend': [
            'do_web_gantt/static/src/**/*',
            'do_web_gantt/static/src/xml/**/*',
        ],
    },



But the button still not showing in the gantt view



Note : yes. this is edited because the previous case looks like hard. or at least I think it's hard because there is no example. but this one have example and I don't know why it doesn't work



Avatar
Annuleer
Beste antwoord

Please try this xml template it will help you to get the button. 

   

       

           

                New Button

           

       

   

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
mei 19
3100
1
feb. 19
7966
1
mrt. 15
4525
1
dec. 23
3006
1
jul. 22
3877