Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
javascriptodoo13
1 Răspunde
7194 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
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!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
How I can get data outside ajax.jsonRpc
javascript odoo13
Imagine profil
Imagine profil
1
iul. 21
12225
Cannot import @website_sale/js/utils
javascript
Imagine profil
Imagine profil
2
nov. 25
497
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
Imagine profil
0
iul. 25
1107
Why use the Lazy Translation function _lt()
javascript
Imagine profil
Imagine profil
1
iul. 25
6369
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
Imagine profil
0
iul. 25
2149
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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