Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
javascriptodoo13
1 Odpoveď
7198 Zobrazenia
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
Zrušiť
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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
How I can get data outside ajax.jsonRpc
javascript odoo13
Avatar
Avatar
1
júl 21
12234
Cannot import @website_sale/js/utils
javascript
Avatar
Avatar
2
nov 25
499
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
Avatar
0
júl 25
1107
Why use the Lazy Translation function _lt()
javascript
Avatar
Avatar
1
júl 25
6371
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
Avatar
0
júl 25
2150
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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