İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

any help to Downgrade js file from v9 to v8

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
javascriptodooV8odoo8.0odoo9.0
5097 Görünümler
Avatar
Ibrahim Zool Odoo


odoo.define('hr_dashboard.dashboard', function (require) {
"use strict";
var core = require('web.core');
var formats = require('web.formats');
var Model = require('web.Model');
var session = require('web.session');
var ajax = require('web.ajax');
var KanbanView = require('web_kanban.KanbanView');
var KanbanRecord = require('web_kanban.Record');
var ActionManager = require('web.ActionManager');
var QWeb = core.qweb;

var _t = core._t;
var _lt = core._lt;

var HrDashboardView = KanbanView.extend({
display_name: _lt('Dashboard'),
icon: 'fa-dashboard text-red',
searchview_hidden: true,// To hide the search and filter bar
events: {
'click .leaves-left': 'leaves_left',
'click .payslip': 'action_payslip',
'click .timesheet': 'action_timesheet',
'click .contract': 'action_contract',
'click .leaves_to_approve': 'action_leaves_to_approve',
'click .timesheets_to_approve': 'action_timesheets_to_approve',
'click .job_applications': 'action_job_applications',
'click .leave_allocations': 'action_leave_allocations',
'click .attendance': 'action_attendance',
'click .expenses': 'action_expenses',
'click #generate_payroll_pdf': function(){this.generate_payroll_pdf("bar");},
'click #generate_attendance_pdf': function(){this.generate_payroll_pdf("pie")},
'click .my_profile': 'action_my_profile',
},
init: function (parent, dataset, view_id, options) {
this._super(parent, dataset, view_id, options);
this.options.creatable = false;
var uid = dataset.context.uid;
var employee_data = true;
var isFirefox = false;
console.log(this)
//Here we can bind any functions to be called before or after render.
//_.bindAll(this, 'render', 'graph');
//var _this = this;
//this.render = _.wrap(this.render, function(render) {
// render();
// _this.graph();
// return _this;
//});
},
fetch_data: function() {
// Overwrite this function with useful data
return $.when();
},
// Here we are calling a function 'get_employee_info' from model to retrieve enough data
render: function() {
var super_render = this._super;
var self = this;
var model = new Model('hr.dashboard').call('get_employee_info').then(function(result){
self.isFirefox = typeof InstallTrigger !== 'undefined';
self.employee_data = result[0]
return self.fetch_data().then(function(result){
var hr_dashboard = QWeb.render('hr_dashboard.dashboard', {
widget: self,
});
super_render.call(self);
$(hr_dashboard).prependTo(self.$el);
self.graph();
})
});
},
leaves_left: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
return this.do_action({
name: _t("Leaves"),
type: 'ir.actions.act_window',
res_model: 'hr.holidays',
src_model: 'hr.employee',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {'search_default_employee_id': [self.employee_data.id],
'default_employee_id': self.employee_data.id,
'search_default_group_type': true,
'search_default_year': true
},
domain: [['holiday_type','=','employee'], ['holiday_status_id.limit', '=', false], ['state','!=', 'refuse']],
search_view_id: self.employee_data.leave_search_view_id,
target: 'current'
})
},
action_payslip: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Payslips"),
type: 'ir.actions.act_window',
res_model: 'hr.payslip',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_employee_id': [self.employee_data.id],
'default_employee_id': self.employee_data.id,
},
target: 'current'
})
},
action_timesheet: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Timesheets"),
type: 'ir.actions.act_window',
res_model: 'hr_timesheet_sheet.sheet',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_employee_id': [self.employee_data.id],
'default_employee_id': self.employee_data.id,
},
target: 'current'
})
},
action_contract: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Contracts"),
type: 'ir.actions.act_window',
res_model: 'hr.contract',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_employee_id': [self.employee_data.id],
'default_employee_id': self.employee_data.id,
},
target: 'current'
})
},
action_leaves_to_approve: function(event) {
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Department Leaves"),
type: 'ir.actions.act_window',
res_model: 'hr.holidays',
view_mode: 'tree,form,calendar',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_approve': true,
},
domain: [['type','=','remove'],],
search_view_id: self.employee_data.leave_search_view_id,
target: 'current'
})
},
action_timesheets_to_approve: function(event) {
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Timesheets to Approve"),
type: 'ir.actions.act_window',
res_model: 'hr_timesheet_sheet.sheet',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_to_approve': true,
},
search_view_id: self.employee_data.timesheet_search_view_id,
target: 'current'
})
},
action_job_applications: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Applications"),
type: 'ir.actions.act_window',
res_model: 'hr.applicant',
view_mode: 'kanban,tree,form,pivot,graph,calendar',
view_type: 'form',
views: [[false, 'kanban'],[false, 'list'],[false, 'form'],
[false, 'pivot'],[false, 'graph'],[false, 'calendar']],
context: {},
search_view_id: self.employee_data.job_search_view_id,
target: 'current'
})
},
action_leave_allocations: function(event) {
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Department Leaves Allocation"),
type: 'ir.actions.act_window',
res_model: 'hr.holidays',
view_mode: 'tree,form,calendar',
view_type: 'form',
views: [[false, 'list'],[false, 'calender']],
context: {
'search_default_approve': true,
},
domain: [['type','=','add'],],
search_view_id: self.employee_data.leave_search_view_id,
target: 'current'
})
},
action_attendance: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Attendances"),
type: 'ir.actions.act_window',
res_model: 'hr.attendance',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
'search_default_today': true,
},
domain: [],
search_view_id: self.employee_data.attendance_search_view_id,
target: 'current'
})
},
action_expenses: function(event){
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("Expense Reports to Approve"),
type: 'ir.actions.act_window',
res_model: 'hr.expense',
view_mode: 'tree,kanban,form,pivot,graph',
view_type: 'form',
views: [[false, 'list'],[false, 'form'],[false, 'kanban'],[false, 'pivot'],[false, 'graph']],
context: {
'search_default_submitted': true,
},
domain: [],
search_view_id: self.employee_data.attendance_search_view_id,
target: 'current'
})
},
action_my_profile: function(event) {
var self = this;
event.stopPropagation();
event.preventDefault();
this.do_action({
name: _t("My Profile"),
type: 'ir.actions.act_window',
res_model: 'hr.employee',
res_id: self.employee_data.id,
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
context: {},
domain: [],
target: 'inline'
})
},
// Function which gives random color for charts.
getRandomColor: function () {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
},
// Here we are plotting bar,pie chart
graph: function() {
var self = this
var ctx = this.$el.find('#myChart')
// Fills the canvas with white background
Chart.plugins.register({
beforeDraw: function(chartInstance) {
var ctx = chartInstance.chart.ctx;
ctx.fillStyle = "white";
ctx.fillRect(0, 0, chartInstance.chart.width, chartInstance.chart.height);
}
});
var bg_color_list = []
for (var i=0;i<=12;i++){
bg_color_list.push(self.getRandomColor())
}
var myChart = new Chart(ctx, {
type: 'bar',
data: {
//labels: ["January","February", "March", "April", "May", "June", "July", "August", "September",
// "October", "November", "December"],
labels: self.employee_data.payroll_label,
datasets: [{
label: 'Payroll',
data: self.employee_data.payroll_dataset,
backgroundColor: bg_color_list,
borderColor: bg_color_list,
borderWidth: 1,
pointBorderColor: 'white',
pointBackgroundColor: 'red',
pointRadius: 5,
pointHoverRadius: 10,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: 'rectRounded'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
min: 0,
max: Math.max.apply(null,self.employee_data.payroll_dataset),
//min: 1000,
//max: 100000,
stepSize: self.employee_data.
payroll_dataset.reduce((pv,cv)=>{return pv + (parseFloat(cv)||0)},0)
/self.employee_data.payroll_dataset.length
}
}]
},
responsive: true,
maintainAspectRatio: true,
animation: {
duration: 100, // general animation time
},
hover: {
animationDuration: 500, // duration of animations when hovering an item
},
responsiveAnimationDuration: 500, // animation duration after a resize
legend: {
display: true,
labels: {
fontColor: 'black'
}
},
},
});
//Pie Chart
var piectx = this.$el.find('#attendanceChart');
bg_color_list = []
for (var i=0;i<=self.employee_data.attendance_dataset.length;i++){
bg_color_list.push(self.getRandomColor())
}
var pieChart = new Chart(piectx, {
type: 'pie',
data: {
datasets: [{
data: self.employee_data.attendance_dataset,
backgroundColor: bg_color_list,
label: 'Attendance Pie'
}],
labels:self.employee_data.attendance_labels,
},
options: {
responsive: true
}
});
$('#emp_details').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel',
{
extend: 'pdf',
footer: 'true',
orientation: 'landscape',
title:'Employee Details',
text: 'PDF',
exportOptions: {
modifier: {
selected: true
}
}
},
{
extend: 'print',
exportOptions: {
columns: ':visible'
}
},
'colvis'
],
columnDefs: [ {
targets: -1,
visible: false
} ],
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
pageLength: 15,
} );
},
generate_payroll_pdf: function(chart){
if (chart == 'bar'){
var canvas = document.querySelector('#myChart');
}
else if (chart == 'pie') {
var canvas = document.querySelector('#attendanceChart');
}

//creates image
var canvasImg = canvas.toDataURL("image/jpeg", 1.0);
var doc = new jsPDF('landscape');
doc.setFontSize(20);
doc.addImage(canvasImg, 'JPEG', 10, 10, 280, 150 );
doc.save('report.pdf');
},
})
// View adding to the registry
core.view_registry.add('hr_dashboard_view', HrDashboardView);
return HrDashboardView
});


4
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Using with_context in super call turns into infinite call in odoo Çözüldü
odooV8 odoo8.0
Avatar
Avatar
Avatar
2
Oca 20
16269
How to call a wizard from js in odoo
javascript odoo9.0
Avatar
Avatar
2
Eki 19
13126
Edit inherited field definition in odoo 8 Çözüldü
odooV8 odoo8.0
Avatar
Avatar
Avatar
Avatar
Avatar
16
Ağu 19
11613
display field depending the value of another field in the view (odoo 8) Çözüldü
odooV8 odoo8.0
Avatar
Avatar
1
Oca 19
6169
Hide print in menu bar
odooV8 odoo8.0
Avatar
Avatar
5
Haz 18
11705
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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