İç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

New employee Button in POS

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
Odoo17
2453 Görünümler
Avatar
jenan soliman

Hello,


I have customized POS screen and I want to add button to select many2many employee when click on the button , the list to slect the employee did not appear the UI, here's the code:

/** @odoo-module **/ 

import { _t } from "@web/core/l10n/translation" ;
import { useBus, useService } from "@web/core/utils/hooks" ;
import { EventBus } from "@odoo/owl" ;
import { registry } from "@web/core/registry" ;
import { ControlButtonsMixin } from "@point_of_sale/app/utils/control_buttons_mixin" ;
import { SelectionPopup } from "@point_of_sale/app/utils/input_popups/selection_popup" ;
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup" ;
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup" ;
import { Component, onMounted, useRef } from "@odoo/owl" ;
import { usePos } from "@point_of_sale/app/store/pos_hook" ;
import { AppointmentList } from "@plnx_pos_appointment/app/appointment_screen/appointment_list/appointment_list" ;
import { AppointmentManagementControlPanel } from "@plnx_pos_appointment/app/appointment_screen/appointment_management_control_panel/appointment_management_control_panel" ;





export class EmployeeSelectionScreen extends ControlButtonsMixin(Component) {
static storeOnOrder = false ;
static template = "plnx_pos_appointment.EmployeeSelectionScreen" ;

setup() {
super.setup();
this .pos = usePos();
this .popup = useService( "popup" );
this .orm = useService( "orm" );
this .root = useRef( "root" );
this .numberBuffer = useService( "number_buffer" );
this .selectedEmployees = [];
this .employees = []; // Initialize employees as an empty array
this .employeeFetcher = useService( "employee_fetcher" );
useBus( this .employeeFetcher, "update" , this .render);
this .toggleEmployeeSelection = this .toggleEmployeeSelection.bind( this );
this .confirmSelection = this .confirmSelection.bind( this );

console.log( "POS Context:" , this .pos);

onMounted(() => {
this .fetchEmployees(); // Fetch employees when mounted
});
}




async fetchEmployees() {
try {
this .employees = await this .employeeFetcher.fetchEmployees();
console.log( "Fetched Employees:" , this .employees);
this .render();
} catch (error) {
console.error( "Error fetching employees:" , error);
}
}

toggleEmployeeSelection(employeeId) {
const index = this .state.selectedEmployeees.indexOf(employeeId);
if (index > - 1 ) {
this .selectedEmployees.splice(index, 1 ); // Remove if already selected
} else {
this .state.selectedEmployees.push(employeeId); // Add if not selected
}
}

// Save selected employees to the current POS order
confirmSelection() {
const order = this .pos.get_order();
if (order) {
order.selectedEmployees = this .state.selectedEmployees;
console.log( "Saved employees to order:" , order.selectedEmployees);
} else {
console.warn( "Do not activate order found." );
}
}




}

registry.category( "pos_screens" ).add( "EmployeeSelectionScreen" , EmployeeSelectionScreen);

<templates id ="template" xml :space ="preserve" >
<t t-name ="plnx_pos_appointment.EmployeeSelectionScreen" >
<div class ="popup-content" >
<h3> Select Employees </h3>
<div class = "employee-list" >
<t t-foreach ="employees" t-as ="employee" t-key ="employee.id" >
<div class ="employee-item" >
<input type ="checkbox"
t -att-checked ="selectedEmployee.includes(employee.id)"
t-att-on-click ="toggleEmployeeSelection(employee.id)" />
<span t-esc ="employee.name" />
</div>
</t>
</div>
<div class ="popup-footer" >
<button t-on-click ="cancel" > Cancel </button>
<button t-on-click ="confirmSelection" > Confirm </button>
</div>
</ div>
</t>
</templates>
/** @odoo-module */

import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen" ;
import { usePos } from "@point_of_sale/app/store/pos_hook" ;
import { Component } from "@odoo/owl" ;
import {onMounted} from "@odoo/owl" ;
import { useBus, useService } from "@web/core/utils/hooks" ;



export class SetEmployeeButton extends Component {
static template = "plnx_pos_appointment.SetEmployeeButton" ;

setup() {
this .pos = usePos();
this .selectedEmployees = [];
this .employees = []; // Initialize employees as an empty array
this .employeeFetcher = useService( "employee_fetcher" );

onMounted(() => {
this .fetchEmployees(); // Fetch employees when mounted
});
}




async fetchEmployees() {
try {
this .employees = await this .employeeFetcher.fetchEmployees();
console.log( "Fetched Employees:" , this .employees);
let emp= this .employees
console.log( "length:" , emp.length)
} catch (error) {
console.error( "Error fetching employees:" , error);
}
}






async click() {
this .pos.showScreen( "EmployeeSelectionScreen" );

}


}

ProductScreen.addControlButton({ component: SetEmployeeButton });

<? xml version ="1.0" encoding ="UTF-8" ?>
<templates id ="template" xml :space ="preserve" >

<t t-name ="plnx_pos_appointment.SetEmployeeButton" >


<div class ="control-button o_appointment_button btn btn-light rounded-0 fw-bolder" t-on-click ="click" >
<i class ="fa fa-user-plus me-1" role ="img" aria-label ="Select Employees" title ="Select Employees" ></i>
Select Employees
</div>

</t>

</templates>


0
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
Displaying Many2one field on mobile devices identical to desktop view in Odoo 17
Odoo17
Avatar
Avatar
1
Tem 25
1547
Update the discount in POS order
Odoo17
Avatar
0
Kas 24
1894
ADD new group under other
Odoo17
Avatar
Avatar
1
Eki 24
3052
Odoo 17 kanban second Progress bar
Odoo17
Avatar
0
Eki 24
1996
Time sheets - Non DB User Employees
Odoo17
Avatar
0
Eki 24
1664
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