Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • 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:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Problems migrating a custom module from odoo 13 to 16

Subscribe

Get notified when there's activity on this post

This question has been flagged
javascriptmigration13odoo16features
1847 Views
Avatar
Felix Reyes

I am trying to migrate a custom module from a progress bar, I put some console logs to debug but apparently the script does not load

Javascript code

console.log("Starting script...");

odoo.define('ipx_dual_sum_kanban_progressbar.KanbanColumnProgressBar', function (require) {

    'use strict';

    

    const core = require('web.core');

    var session = require('web.session');

    var utils = require('web.utils');

    var Widget = require('web.Widget');

    var ajax = require ('web.ajax');

    

    const _t = core._t;

    // taking the instance of KanbanColumnProgressBar

    var KanbanColumnProgressBar = require('web.KanbanColumnProgressBar');

        

    // extending the KanbanColumnProgressBar

    KanbanColumnProgressBar.include({

        init: function (parent, options, columnState){

            console.log("Inside init function...");

            this\._super\.apply\(this,\ arguments\);

 \  \  \  \  \  \ var\ parent\ =\ arguments\[0\]

 \  \  \  \  \  \ var\ options\ =\ arguments\[1\]

 \  \  \  \  \  \ var\ columnState\ =\ arguments\[2\]

 \  \  \  \  \  

 \  \  \  \  \  \ this\.sumFieldB\ =\ columnState\.progressBarValues\.sum_fieldB;

 \  \  \  \  \   

 \  \  \  \  \  \ this\.isSumFieldB\ =\ this\.sumFieldB\ \?\ true\ :\ false;

 \   

 \  \  \  \  \  \ var\ state\ =\ options\.progressBarStates\[this\.columnID\];

 \  \  \  \  \  \ if\ \(state\)\ \{

 \  \  \  \  \  \  \  \ this\.groupCount\ =\ state\.groupCount;

 \  \  \  \  \  \  \  \ this\.subgroupCounts\ =\ state\.subgroupCounts;

 \  \  \  \  \  \  \  \ this\.totalCounterValue\ =\ state\.totalCounterValue;

 \   

 \  \  \  \  \  \  \  \ this\.totalCounterValueB\ =\ state\.totalCounterValueB;

 \   

 \  \  \  \  \  \  \  \ this\.activeFilter\ =\ state\.activeFilter;

 \  \  \  \  \  \ \}

 \   

 \  \  \  \  \  \ var\ sumFieldInfoB\ =\ this\.sumFieldB\ \&\&\ columnState\.fieldsInfo\.kanban\[this\.sumFieldB\];

 \  \  \  \  \  \ var\ currencyFieldB\ =\ sumFieldInfoB\ \&\&\ sumFieldInfoB\.options\ \&\&\ sumFieldInfoB\.options\.currency_field;

 \  \  \  \  \  \ if\ \(currencyFieldB\ \&\&\ columnState\.data\.length\)\ \{

 \  \  \  \  \  \  \  \ this\.currencyB\ =\ session\.currencies\[columnState\.data\[0\]\.data\[currencyFieldB\]\.res_id\];

 \  \  \  \  \  \ \}

 \   

 \  \  \  \ \},

 \  \  \   

 \  \  \  \ start:\ function\(\)\ \{

 \  \  \  \  \  \ console\.log\("Inside\ start\ function\.\.\."\);

 \  \  \  \  \  \ var\ self\ =\ this;

 \   

 \  \  \  \  \  \ this\.\$counterB\ =\ this\.\$\('\.o_kanban_counter_side_b'\);

 \  \  \  \  \  \ this\.\$numberB\ =\ this\.\$counterB\.find\('b'\);

 \   

 \  \  \  \  \  \ if\ \(this\.currencyB\)\ \{

 \  \  \  \  \  \  \  \ var\ \$currencyB\ =\ \$\('',\ \{

 \  \  \  \  \  \  \  \  \  \ text:\ this\.currencyB\.symbol,

 \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \ if\ \(this\.currencyB\.position\ ===\ 'before'\)\ \{

 \  \  \  \  \  \  \  \  \  \ \$currencyB\.prependTo\(this\.\$counterB\);

 \  \  \  \  \  \  \  \ \}\ else\ \{

 \  \  \  \  \  \  \  \  \  \ \$currencyB\.appendTo\(this\.\$counterB\);

 \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \ \}

 \   

 \  \  \  \  \  \ self\.prevTotalCounterValueB\ =\ self\.totalCounterValueB;

 \  \  \  \  \  \ self\.totalCounterValueB\ =\ self\.sumFieldB\ \?\ \(self\.columnState\.aggregateValues\[self\.sumFieldB\]\ \|\|\ 0\)\ :\ 0;

 \  \  \  \  \   

 \  \  \  \  \  \ //\ add\ console\ logs

 \  \  \  \  \   


 \   

 \  \  \  \  \  \ return\ this\._super\.apply\(this,\ arguments\)\.then\(function\ \(\)\ \{

 \  \  \  \  \  \  \  \ //\ This\ should\ be\ executed\ when\ the\ progressbar\ is\ fully\ rendered

 \  \  \  \  \  \  \  \ //\ and\ is\ in\ the\ DOM,\ this\ happens\ to\ be\ always\ the\ case\ with

 \  \  \  \  \  \  \  \ //\ current\ use\ of\ progressbars

 \   

 \  \  \  \  \  \  \  \ var\ subgroupCounts\ =\ \{\};

 \  \  \  \  \  \  \  \ let\ allSubgroupCount\ =\ 0;

 \  \  \  \  \  \  \  \ _\.each\(self\.colors,\ function\ \(val,\ key\)\ \{

 \  \  \  \  \  \  \  \  \  \ var\ subgroupCount\ =\ self\.columnState\.progressBarValues\.counts\[key\]\ \|\|\ 0;

 \  \  \  \  \  \  \  \  \  \ if\ \(self\.activeFilter\ ===\ key\ \&\&\ subgroupCount\ ===\ 0\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ self\.activeFilter\ =\ false;

 \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \  \  \ subgroupCounts\[key\]\ =\ subgroupCount;

 \  \  \  \  \  \  \  \  \  \ allSubgroupCount\ \+=\ subgroupCount;

 \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \ subgroupCounts\.__false\ =\ self\.columnState\.count\ \-\ allSubgroupCount;

 \   

 \  \  \  \  \  \  \  \ self\.groupCount\ =\ self\.columnState\.count;

 \  \  \  \  \  \  \  \ self\.subgroupCounts\ =\ subgroupCounts;

 \  \  \  \  \  \  \  \ self\.prevTotalCounterValue\ =\ self\.totalCounterValue;

 \  \  \  \  \  \  \  \ self\.totalCounterValue\ =\ self\.sumField\ \?\ \(self\.columnState\.aggregateValues\[self\.sumField\]\ \|\|\ 0\)\ :\ self\.columnState\.count;

 \   

 \  \  \  \  \  \  \  \ //MY\ EDIT\ START

 \  \  \  \  \  \  \  \ self\.prevTotalCounterValueB\ =\ self\.totalCounterValueB;

 \  \  \  \  \  \  \  \ self\.totalCounterValueB\ =\ self\.sumFieldB\ \?\ \(self\.columnState\.aggregateValues\[self\.sumFieldB\]\ \|\|\ 0\)\ :\ 0;

 \   

 \  \  \  \  \  \  \  \ //MY\ EDIT\ END

 \  \  \  \  \  \  \  

 \  \  \  \  \  \  \  \ self\._notifyState\(\);

 \  \  \  \  \  \  \  \ self\._render\(\);

 \  \  \  \  \  \ \}\);

 \   

 \  \  \  \ \},

 \  \  \  \ _render:\ function\ \(\)\ \{

 \  \  \  \  \  \ console\.log\("Inside\ _render\ function\.\.\."\);

 \  \  \  \  \  \  \  \ var\ self\ =\ this;

 \  \  \   

 \  \  \  \  \  \  \  \ //\ Update\ column\ display\ according\ to\ active\ filter

 \  \  \  \  \  \  \  \ this\.trigger_up\('tweak_column',\ \{

 \  \  \  \  \  \  \  \  \  \ callback:\ function\ \(\$el\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ \$el\.removeClass\('o_kanban_group_show'\);

 \  \  \  \  \  \  \  \  \  \  \  \ _\.each\(self\.colors,\ function\ \(val,\ key\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ \$el\.removeClass\('o_kanban_group_show_'\ \+\ val\);

 \  \  \  \  \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \  \  \  \  \ if\ \(self\.activeFilter\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ \$el\.addClass\('o_kanban_group_show\ o_kanban_group_show_'\ \+\ self\.colors\[self\.activeFilter\]\);

 \  \  \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \  \  \ \},

 \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \ this\.trigger_up\('tweak_column_records',\ \{

 \  \  \  \  \  \  \  \  \  \ callback:\ function\ \(\$el,\ recordData\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ var\ categoryValue\ =\ recordData\[self\.fieldName\]\ \?\ recordData\[self\.fieldName\]\ :\ '__false';

 \  \  \  \  \  \  \  \  \  \  \  \ _\.each\(self\.colors,\ function\ \(val,\ key\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ \$el\.removeClass\('oe_kanban_card_'\ \+\ val\);

 \  \  \  \  \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \  \  \  \  \ if\ \(self\.colors\[categoryValue\]\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ \$el\.addClass\('oe_kanban_card_'\ \+\ self\.colors\[categoryValue\]\);

 \  \  \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \  \  \ \},

 \  \  \  \  \  \  \  \ \}\);

 \  \  \   

 \  \  \  \  \  \  \  \ //\ Display\ and\ animate\ the\ progress\ bars

 \  \  \  \  \  \  \  \ var\ barNumber\ =\ 0;

 \  \  \  \  \  \  \  \ var\ barMinWidth\ =\ 6;\ //\ In\ %

 \  \  \  \  \  \  \  \ const\ selection\ =\ self\.columnState\.fields\[self\.fieldName\]\.selection;

 \  \  \  \  \  \  \  \ _\.each\(self\.colors,\ function\ \(val,\ key\)\ \{

 \  \  \  \  \  \  \  \  \  \ var\ \$bar\ =\ self\.\$bars\[key\];

 \  \  \  \  \  \  \  \  \  \ var\ count\ =\ self\.subgroupCounts\ \&\&\ self\.subgroupCounts\[key\]\ \|\|\ 0;

 \  \  \   

 \  \  \  \  \  \  \  \  \  \ if\ \(!\$bar\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ return;

 \  \  \  \  \  \  \  \  \  \ \}

 \  \  \   

 \  \  \  \  \  \  \  \  \  \ //\ Adapt\ tooltip

 \  \  \  \  \  \  \  \  \  \ let\ value;

 \  \  \  \  \  \  \  \  \  \ if\ \(selection\)\ \{\ //\ progressbar\ on\ a\ field\ of\ type\ selection

 \  \  \  \  \  \  \  \  \  \  \  \ const\ option\ =\ selection\.find\(option\ =>\ option\[0\]\ ===\ key\);

 \  \  \  \  \  \  \  \  \  \  \  \ value\ =\ option\ \&\&\ option\[1\]\ \|\|\ _t\('Other'\);

 \  \  \  \  \  \  \  \  \  \ \}\ else\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ value\ =\ key;

 \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \  \  \ \$bar\.attr\('data\-original\-title',\ count\ \+\ '\ '\ \+\ value\);

 \  \  \  \  \  \  \  \  \  \ \$bar\.tooltip\(\{

 \  \  \  \  \  \  \  \  \  \  \  \ delay:\ 0,

 \  \  \  \  \  \  \  \  \  \  \  \ trigger:\ 'hover',

 \  \  \  \  \  \  \  \  \  \ \}\);

 \  \  \   

 \  \  \  \  \  \  \  \  \  \ //\ Adapt\ active\ state

 \  \  \  \  \  \  \  \  \  \ \$bar\.toggleClass\('progress\-bar\-animated\ progress\-bar\-striped',\ key\ ===\ self\.activeFilter\);

 \  \  \   

 \  \  \  \  \  \  \  \  \  \ //\ Adapt\ width

 \  \  \  \  \  \  \  \  \  \ \$bar\.removeClass\('o_bar_has_records\ transition\-off'\);

 \  \  \  \  \  \  \  \  \  \ window\.getComputedStyle\(\$bar\[0\]\)\.getPropertyValue\('width'\);\ //\ Force\ reflow\ so\ that\ animations\ work

 \  \  \  \  \  \  \  \  \  \ if\ \(count\ >\ 0\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.addClass\('o_bar_has_records'\);

 \  \  \  \  \  \  \  \  \  \  \  \ //\ Make\ sure\ every\ bar\ that\ has\ records\ has\ some\ space

 \  \  \  \  \  \  \  \  \  \  \  \ //\ and\ that\ everything\ adds\ up\ to\ 100%

 \  \  \  \  \  \  \  \  \  \  \  \ var\ maxWidth\ =\ 100\ \-\ barMinWidth\ \*\ barNumber;

 \  \  \  \  \  \  \  \  \  \  \  \ self\.\$\('\.progress\-bar\.o_bar_has_records'\)\.css\('max\-width',\ maxWidth\ \+\ '%'\);

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.css\('width',\ \(count\ \*\ 100\ /\ self\.groupCount\)\ \+\ '%'\);

 \  \  \  \  \  \  \  \  \  \  \  \ barNumber\+\+;

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.attr\('aria\-valuemin',\ 0\);

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.attr\('aria\-valuemax',\ self\.groupCount\);

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.attr\('aria\-valuenow',\ count\);

 \  \  \  \  \  \  \  \  \  \ \}\ else\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ \$bar\.css\('width',\ ''\);

 \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \ this\.\$\('\.progress\-bar\.o_bar_has_records'\)\.css\('min\-width',\ barMinWidth\ \+\ '%'\);

 \  \  \   

 \  \  \  \  \  \  \  \ //\ Display\ and\ animate\ the\ counter\ number

 \  \  \  \  \  \  \  \ var\ start\ =\ this\.prevTotalCounterValue;

 \  \  \  \  \  \  \  \ var\ end\ =\ this\.totalCounterValue;

 \  \  \   

 \  \  \  \  \  \  \  \ if\ \(this\.activeFilter\)\ \{

 \  \  \  \  \  \  \  \  \  \ if\ \(this\.sumField\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ end\ =\ 0;

 \  \  \  \  \  \  \  \  \  \  \  \ _\.each\(self\.columnState\.data,\ function\ \(record\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ var\ recordData\ =\ record\.data;

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ if\ \(self\.activeFilter\ ===\ recordData\[self\.fieldName\]\ \|\|

 \  \  \  \  \  \  \  \  \  \  \  \  \  \  \  \ \(self\.activeFilter\ ===\ '__false'\ \&\&\ !recordData\[self\.fieldName\]\)\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \  \  \ end\ \+=\ parseFloat\(recordData\[self\.sumField\]\);

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \  \  \ \}\ else\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ end\ =\ this\.subgroupCounts\[this\.activeFilter\];

 \  \  \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \  \ this\.prevTotalCounterValue\ =\ end;

 \  \  \  \  \  \  \  \ var\ animationClass\ =\ start\ >\ 999\ \?\ 'o_kanban_grow'\ :\ 'o_kanban_grow_huge';

 \  \  \   

 \  \  \  \  \  \  \  \ if\ \(start\ !==\ undefined\ \&\&\ \(end\ >\ start\ \|\|\ this\.activeFilter\)\ \&\&\ this\.ANIMATE\)\ \{

 \  \  \  \  \  \  \  \  \  \ \$\(\{currentValue:\ start\}\)\.animate\(\{currentValue:\ end\},\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ duration:\ 1000,

 \  \  \  \  \  \  \  \  \  \  \  \ start:\ function\ \(\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ self\.\$counter\.addClass\(animationClass\);

 \  \  \  \  \  \  \  \  \  \  \  \ \},

 \  \  \  \  \  \  \  \  \  \  \  \ step:\ function\ \(\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ self\.\$number\.html\(_getCounterHTML\(this\.currentValue\)\);

 \  \  \  \  \  \  \  \  \  \  \  \ \},

 \  \  \  \  \  \  \  \  \  \  \  \ complete:\ function\ \(\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ self\.\$number\.html\(_getCounterHTML\(this\.currentValue\)\);

 \  \  \  \  \  \  \  \  \  \  \  \  \  \ self\.\$counter\.removeClass\(animationClass\);

 \  \  \  \  \  \  \  \  \  \  \  \ \},

 \  \  \  \  \  \  \  \  \  \ \}\);

 \  \  \  \  \  \  \  \ \}\ else\ \{

 \  \  \  \  \  \  \  \  \  \ this\.\$number\.html\(_getCounterHTML\(end\)\);

 \  \  \  \  \  \  \  \ \}

 \  \  \  \  \  \  \   

 \  \  \  \  \  \  \   

 \  \  \  \  \  \  \  \ //=========================MY\ EDIT\ START

 \  \  \  \  \  \  \   

 \  \  \  \  \  \  \  \ //\ Display\ and\ animate\ the\ counter\ number

 \  \  \  \  \  \  \  \ var\ startB\ =\ this\.prevTotalCounterValueB;

 \  \  \  \  \  \  \  \ var\ endB\ =\ this\.totalCounterValueB;

 \  \  \  \  \  \  \   

 \  \  \  \  \  \  \  \ if\ \(this\.activeFilter\)\ \{

 \  \  \  \  \  \  \  \  \  \ if\ \(this\.sumFieldB\)\ \{

 \  \  \  \  \  \  \  \  \  \  \  \ endB\ =\ 0;

 \  \  \  \  \  \  \  \  \  \  \  \ _\.each\(self.columnState.data, function (record) {

                            var recordDataB = record.data;

                            if (self.activeFilter === recordDataB[self.fieldName] ||

                                (self.activeFilter === '__false' && !recordDataB[self.fieldName])) {

                                endB += parseFloat(recordDataB[self.sumFieldB]);

                            }

                        });

                    } else {

                        endB = this.subgroupCounts[this.activeFilter];

                    }

                }

                this.prevTotalCounterValueB = endB;

                

                var animationClassB = startB > 999 ? 'o_kanban_grow' : 'o_kanban_grow_huge';

        

                if (startB !== undefined && (endB > startB || this.activeFilter) && this.ANIMATE) {

                    $({currentValueB: startB}).animate({currentValueB: endB}, {

                        duration: 1000,

                        start: function () {

                            self.$counterB.addClass(animationClassB);

                        },

                        step: function () {

                            self.$numberB.html(_getCounterHTML(this.currentValueB));

                        },

                        complete: function () {

                            self.$numberB.html(_getCounterHTML(this.currentValueB));

                            self.$counterB.removeClass(animationClassB);

                        },

                    });

                } else {

                    this.$numberB.html(_getCounterHTML(endB));

                }

                this.$numberB.html(_getCounterHTML(endB));

                

                //========================MY EDIT END

                function _getCounterHTML(value) {

                    return utils.human_number(value, 0, 3);

                } 

                            

            },

            _notifyState: function () {

                this.trigger_up('set_progress_bar_state', {

                    columnID: this.columnID,

                    values: {

                        groupCount: this.groupCount,

                        subgroupCounts: this.subgroupCounts,

                        totalCounterValue: this.totalCounterValue,

                        totalCounterValueB: this.totalCounterValueB,

                        isSumFieldB: this.isSumFieldB,

                        activeFilter: this.activeFilter,

                        

                    },

                });

            }

        });

    });


XML code:


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

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

Sign up
Related Posts Replies Views Activity
Problems migrating from odoo 13 to 16
javascript migration odoo16features
Avatar
0
नव॰ 23
1946
Field used in context is restricted to certain groups Solved
migration odoo16features
Avatar
Avatar
Avatar
3
जून 24
4255
Can't log the console inside the include javascript Odoo v16 Solved
javascript odoo16features
Avatar
Avatar
1
अप्रैल 24
3187
Odoo 16.0 CE - Missing widget: radio_reduce_selection for field of type selection
javascript odoo16features
Avatar
0
जन॰ 24
2693
What is the Best Practice for Integrating JavaScript in Odoo 16?
javascript odoo16features
Avatar
Avatar
1
सित॰ 23
4323
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

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