Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

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

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
javascriptodoo13
1 Відповісти
7214 Переглядів
Аватар
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
Аватар
Відмінити
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!

Реєстрація
Related Posts Відповіді Переглядів Дія
How I can get data outside ajax.jsonRpc
javascript odoo13
Аватар
Аватар
1
лип. 21
12237
Cannot import @website_sale/js/utils
javascript
Аватар
Аватар
2
лист. 25
529
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
Аватар
0
лип. 25
1110
Why use the Lazy Translation function _lt()
javascript
Аватар
Аватар
1
лип. 25
6383
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
Аватар
0
лип. 25
2159
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

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