Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Odoo 13 : Error Js “Could not find client action”

Subscriure's

Get notified when there's activity on this post

This question has been flagged
javascriptodoo13
1 Respondre
8219 Vistes
Avatar
E-ACTA

I received the following error : Could not find client action eacta_previsionnel_hebdomadaire

XML code  

<record id="eacta_previsionnel_report_action_client" model="ir.actions.client"  >
    <field name="name">Prévisionnel hebdomadaire</field>
    <field name="tag">eacta_previsionnel_hebdomadaire</field>
</record>
 JS code :
odoo.define('eacta_previsionnel.eacta_previsionnel_hebdomadaire', function (require) {
'use strict';

var core = require('web.core');
var Widget = require('web.Widget');
var ControlPanelMixin = require('web.ControlPanelMixin');
var AbstractAction = require('web.AbstractAction');
var SearchView = require('web.SearchView');
var data = require('web.data');
var pyeval = require('web.pyeval');
var field_utils = require('web.field_utils');
var session = require('web.session');
var datepicker = require('web.datepicker');

var QWeb = core.qweb;
var _t = core._t;

var ClientAction  = AbstractAction.extend(ControlPanelMixin, {
    custom_events: {
        search: '_onSearch',
    },

    events:{
        'change .o_eacta_date_start': 'on_change_date_start',
        'change .o_mps_save_input_text': 'save_line_prevision',
        'click .o_eacta_product_name': 'open_eacta_product',
        'click .o_eacta_variete_name': 'open_eacta_plantation',
        'click .o_eacta_next_week': 'on_click_next_week',
        'click .o_eacta_prev_week': 'on_click_prev_week',
    },
    init: function(parent, action) {
        this.actionManager = parent;
        this.action = action;
        this.domain = [];
        return this._super.apply(this, arguments);
    },
    render_search_view: function(){
        var self = this;
        var defs = [];
        this._rpc({
                model: 'ir.model.data',
                method: 'get_object_reference',
                args: ['eacta_mrp_base', 'eacta_search_mrp_farm_plantation'],
            })
            .then(function(view_id){
                self.dataset = new data.DataSetSearch(this, 'eacta.r.variete.serre.period');
                self.loadFieldView(self.dataset, view_id[1], 'search')
                .then(function (fields_view) {
                    self.fields_view = fields_view;
                    var options = {
                        $buttons: $("<div>"),
                        action: this.action,
                        disable_groupby: true,
                    };
                    self.searchview = new SearchView(self, self.dataset, self.fields_view, options);
                    self.searchview.appendTo($("<div>")).then(function () {
                        self.$searchview_buttons = self.searchview.$buttons.contents();
                        self.update_cp();
                        defs.push(self.update_cp());
                    });
                });
            });
    },
    willStart: function() {
        return this.get_html();
    },
    start: function() {
        var self = this;
        this.render_search_view();
        return this._super.apply(this, arguments).then(function () {
            self.$el.html(self.html);
        });
    },
    re_renderElement: function() {
        this.$el.html(this.html);
        this.update_cp();
    },
    open_eacta_product: function(e){
        this.do_action({
            type: 'ir.actions.act_window',
            res_model: "eacta.conf.culture",
            res_id: parseInt($(e.target).data('product')),
            views: [[false, 'form']],
        });
    },
    open_eacta_plantation: function(e){
        this.do_action({
            type: 'ir.actions.act_window',
            res_model: "eacta.r.variete.serre.period",
            res_id: parseInt($(e.target).data('plantation')),
            views: [[false, 'form']],
        });
    },
    save_line_prevision: function(e){
        var self = this;
        var $input = $(e.target);
        var target_value;
        try {
            target_value = field_utils.parse.float($input.val().replace(String.fromCharCode(8209), '-'));
        } catch(err) {
            return this.do_warn(_t("Wrong value entered!"), err);
        }
        return this._rpc({
            model: 'eacta.data.recolte.previsionnel',
            method: 'save_line_prevision',
            args: [field_utils.parse.float($input.val()), parseInt($input.data('plantation')),$input.data('date')],
        })
        .done(function(res){
            self.get_html().then(function() {
                self.re_renderElement();
                self.update_cp();
            });
        });
    },
    on_change_date_start: function(e){
        var self = this;
        var $input = $(".o_eacta_date_start").val();
        var target_value;
        try {
            if ($input == ''){
                this.do_warn(_t("Wrong value entered!"), "<ul><li>Date de debut</li></ul>");
                return;
            }
//            target_value = field_utils.format.date(field_utils.parse.date($input, {}, {isUTC: true}));
        } catch(err) {
            return this.do_warn(_t("Wrong value entered!"), err);
        }
        return this._rpc({
                model: 'eacta.previsionnel.hebdomadaire',
                method: 'search',
                args: [[]],
            })
            .then(function(res){
                return self._rpc({
                        model: 'eacta.previsionnel.hebdomadaire',
                        method: 'write',
                        args: [res, {'date_start': $input}],
                })
                .done(function(result){
                    self.get_html().then(function() {
                        self.re_renderElement();
                        self.update_cp();
                    });
                });
        });
    },
    on_click_next_week: function(e){
        var self = this;
        var date = self.operation_date("next",7);
        var max_next_date = new Date(date[2], parseInt(date[1])-1,date[0])
        var date_max = new Date($('.o_eacta_date_start').getAttributes()["date-max"]);
        if (max_next_date > date_max)
            $(".o_eacta_date_start").val(field_utils.parse.date(date_max).format('DD/MM/YYYY'));
        else
            $(".o_eacta_date_start").val(date[0] + "/" + date[1] + "/" + date[2]);
        self.on_change_date_start();
    },
    on_click_prev_week: function(e){
        var self = this;
        var date = self.operation_date("prev",7);
        var min_prev_date = new Date(date[2], parseInt(date[1])-1,date[0])
        var date_min = new Date($('.o_eacta_date_start').getAttributes()["date-min"]);
        if (min_prev_date < date_min)
            $(".o_eacta_date_start").val(field_utils.parse.date(date_min).format('DD/MM/YYYY'));
        else
            $(".o_eacta_date_start").val(date[0] + "/" + date[1] + "/" + date[2]);
        self.on_change_date_start();
    },
    operation_date: function(operation,nbr_day){
        var counter = 0;
        counter = counter + nbr_day;
        var today = new Date($(".o_eacta_date_start").datepicker( "getDate" ));
        if (operation == "next")
            today.setDate(today.getDate() + counter);
        else if (operation == "prev")
            today.setDate(today.getDate() - counter);
        var formattedDate = new Date(today);
        var d = ("0" + formattedDate.getDate()).slice(-2);
        var m = ("0" + (formattedDate.getMonth() + 1)).slice(-2);
        var y = formattedDate.getFullYear();
        return [d,m,y]
    },
    get_html: function() {
        var self = this;
        return this._rpc({
                model: 'eacta.previsionnel.hebdomadaire',
                method: 'get_html',
                args: [this.domain],
            })
            .then(function (result) {
                self.html = result.html;
                self.report_context = result.report_context;
            });
    },
    update_cp: function() {
        var self = this;
        self.readonly_input_previsionnel();
        self.enabled_input_previsionnel();
        self.sous_total_previsionnel();
        self.total_previsionnel();
        self.total_sous_total_previsionnel();
        self.visibility_icon_next();
        self.visibility_icon_prev();
        this.update_control_panel({
            breadcrumbs: this.actionManager.get_breadcrumbs(),
            cp_content: {
                $buttons: this.$buttons,
                $searchview: this.searchview.$el,
                // $searchview_buttons: this.$searchview_buttons,
                $searchview_buttons: this.$searchview_buttons
             },
             searchview: this.searchview,
        });
    },
    total_previsionnel: function() {
        $('.demand_forecast').each(function () {
            var sum = 0.00
            $(this).find('.text-right .o_mps_save_input_text').each(function () {
                sum += Number(field_utils.parse.float($(this).context.value));
            });
            $(this).find('.o_mps_save_input_text_total').html(field_utils.format.float(sum));
        });
    },
    sous_total_previsionnel: function(){
        var list_periode = [];
        var sum = 0.00;
        $('tr.demand_forecast:first td.text-right input').each(function () {
            list_periode.push($(this)[0].attributes['data-date'].value);
        });
        for (var i = 0;i< list_periode.length;i++){
            $('.demand_forecast') .parent() .each(function () {
                sum = 0.00;
                $(this).find('input[data-date='+list_periode[i]+']').each(function () {
                    sum += field_utils.parse.float($(this).context.value);
                });
                $(this).parent().find('span[class=o_eacta_sous_total][data-date='+list_periode[i]+']').html(field_utils.format.float(sum));
            });
        }
    },
    total_sous_total_previsionnel: function(){
        var sum = 0.00;
        $('.demand_forecast').parent().parent().each(function () {
            $(this).find('span[class=o_eacta_sous_total]').each(function () {
                sum += field_utils.parse.float($(this).text());
            });
            $(this).find('tr.active td:last .o_eacta_total_sous_total').html(field_utils.format.float(sum));
            sum = 0.00;
        });
    },
    enabled_input_previsionnel: function() {
        $('.demand_forecast').each(function () {
            $(this).find('.eacta_readonly').each(function () {
                $(this).prop('disabled', true);
                $(this).prop('readonly', true);
                $(this).css('background-color', 'transparent');
                $(this).css('color', '#AEA79F');
            });
        });
    },
    readonly_input_previsionnel: function() {
        $('.demand_forecast').each(function () {
            $(this).find('.eacta_input_span_readonly').each(function () {
                $(this).prop('disabled', true);
                $(this).prop('readonly', true);
                $(this).css('background-color', '#ffffff');
                $(this).css('border', 'medium none');
            });
        });
    },
    visibility_icon_next:function(){
        var self = this;
        var date = self.operation_date("next",7);
        var max_next_date = new Date(date[2], parseInt(date[1])-1,date[0])
        var date_max = new Date($('.o_eacta_date_start').getAttributes()["date-max"]);
        if (max_next_date > date_max)
            $('.o_eacta_next_week').css('visibility', 'hidden');
        else
            $('.o_eacta_next_week').css('visibility', 'visible');

    },
    visibility_icon_prev:function(){
        var self = this;
        var date = self.operation_date("prev",7);
        var min_prev_date = new Date(date[2], parseInt(date[1])-1,date[0])
        var date_min = new Date($('.o_eacta_date_start').getAttributes()["date-min"]);
        if (min_prev_date < date_min)
            $('.o_eacta_prev_week').css('visibility', 'hidden');
        else
            $('.o_eacta_prev_week').css('visibility', 'visible');
    },
    _onSearch: function (event) {
        var session = this.getSession();
        var result = pyeval.eval_domains_and_contexts({
            contexts: [session.user_context],
            domains: event.data.domains
        });
        this.domain = result.domain;
        this.update_cp();
        this.get_html().then(this.re_renderElement.bind(this));
    },
});

core.action_registry.add('eacta_previsionnel_hebdomadaire', ClientAction );
return ClientAction ;
});
What im doing wrong here?  

Thanks

0
Avatar
Descartar
Vysakh B Thottarath

I also have the same problem..

Have you got the solution ?

I think the bug is due to removal of web.ControlPanelMixin from Odoo 13

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
How I can get data outside ajax.jsonRpc
javascript odoo13
Avatar
Avatar
1
de jul. 21
13694
[[✦『Guía☎『Volaris』☎México』✦]]0536 ¿Cómo hablar con un asesor Volaris México?
javascript
Avatar
0
d’abr. 26
18
Odoo Chatter Edit/Create Permissions With Only Model Read?
javascript
Avatar
0
d’abr. 26
7
Display outstanding invoices
javascript
Avatar
0
de març 26
5
Error While Installing Accounting Module in Odoo 19 Enterprise (Works on Another PC)
javascript
Avatar
0
de nov. 25
195
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now