Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2559 Visualizzazioni

Hi everyone! I created a JS button located in the sale order line that call a python method and opens an action as a popup. 

The goal here is that the user can access to that button and do something, the very next moment it clicks on "Add a Line" on a Sale Order.

The issue I'm having is that inside the python method, the sale order line is not created yet and therefore anything I do afterwards is useless.

How can I make sure that when I click the JS button, my Sale Order Line get created before?


This is the event and the call of the js function:

events:_.extend({}, Widget.prototype.events,{'click':'_openBudgetSplit',}),
/**
* @private
* @param{MouseEvent}event
* @returns{Promise} action loaded
*/
async_openBudgetSplit(ev) {
    ev.stopPropagation();
    this.$el.find('.fa-percent').prop('special_click', true);
    var action = awaitthis._rpc({
        model:'sale.order.line',
        method:'action_show_budget_split',
        args: [[this.model.data.id], this.product_id, [this.product]]            });
    return this.do_action(action);


Thanks a lot in advance :)

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 22
14010
2
apr 22
4140
1
apr 22
3192
1
lug 25
3485
10
dic 24
31151