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

Odoo file upload after drag and drop

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
uploadodoo10drag&dropodoov10odoo-10
4 Cevaplar
10968 Görünümler
Avatar
Willmore BattleShipNet

I would like to allow a user to drag and drop a file onto span defined in data/dragdrop.xml . I managed to catch drop event but cannot make file upload. What do I have to do?


    <?xml version="1.0" encoding="UTF-8"?>
    <templates>
       <t t-name="mail.chatter.ChatComposer" t-extend="mail.chatter.ChatComposer">
           <t t-jquery=".o_composer_attachments_list" t-operation="before">
                <span class="o_chatter_composer_info" id="chatter_drop_target">
                    ~~~drag here~~~
                </span>
            </t>
        </t>
    </templates>


This is the code for module but it doesn't work. Where is my mistake in code? After drag and drop a file icon appears also in console I can see that file upload request status is 200. But the file icon is still showing "uploading" like the file didn't finish upload.


    odoo.define('dragdrop1.dragdrop', function(require) {
        "use strict";
        
    
        var core = require('web.core');
    
        var Composer = require('mail.composer');
    
        var MailThread = core.form_widget_registry.get('mail_thread');
    
        var ExtendedBasicComposer = Composer.BasicComposer.include({
            ondrop: function(event) {
                var form_upload = document.querySelector('form.o_form_binary_form');
    
                if (null === form_upload) {
                    return;
                }
    
                var form_data = new FormData(form_upload);
                var e = event.originalEvent;
                for (var iterator = 0, file; file = e.dataTransfer.files[iterator]; iterator++) {
                    if (file.name !== '') {
                        var filename = file.name.replace(/.*[\\\/]/,'');
                        // if the files exits for this answer, delete the file before upload
                        var attachments = [];
                        for (var i in this.get('attachment_ids')) {
                            if ((this.get('attachment_ids')[i].filename || this.get('attachment_ids')[i].name) === filename) {
                                if (this.get('attachment_ids')[i].upload) {
                                    //return false;
                                }
                                this.AttachmentDataSet.unlink([this.get('attachment_ids')[i].id]);
                            } else {
                                attachments.push(this.get('attachment_ids')[i]);
                            }
                        }
                        var form_data = new FormData(this.$('form.o_form_binary_form'));
                        form_data.set('ufile', file);
                        // submit filename
                        this.$('form.o_form_binary_form').submit();
                        this.$attachment_button.prop('disabled', true);
            
                        attachments.push({
                            'id': 0,
                            'name': filename,
                            'filename': filename,
                            'url': '',
                            'upload': true,
                            'mimetype': '',
                        });
                        this.set('attachment_ids', attachments);
                    }
                }
            },    
        });
    
        var NewChatterX = MailThread.include({
            on_open_composer_log_note: function(){
                this._super.apply(this, arguments);
                var self = this;
                var c = self.composer;
                var main = document.querySelector('body'); 
                $(document).on('drop', '#chatter_drop_target', function(event){
                    event.stopPropagation();
                    event.preventDefault();
                    c.ondrop(event);
                });
                $(document).on('dragenter', '#chatter_drop_target', function(event){
                    event.preventDefault();
                });
                $(document).on('dragover', '#chatter_drop_target', function(event){
                    event.stopPropagation();
                    event.preventDefault();
                });
                $(document).on('dragleave', '#chatter_drop_target', function(event){
                    event.preventDefault();
                });
            },
        });
        
    });

Any help appreciated, Thank you.

0
Avatar
Vazgeç
Avatar
Sudhir Arya (ERP Harbor Consulting Services)
En İyi Yanıt

Hi,

Why are you writing it when we have the module available for this feature?

Followings are the links of the modules:

OCA

ERP Harbor

Sudhir Arya
ERP Harbor Consulting Services
Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
5
Avatar
Vazgeç
Avatar
Victor
En İyi Yanıt

Hi, this module is great

https://apps.odoo.com/apps/modules/18.0/drag_and_drop_binary_field

0
Avatar
Vazgeç
Avatar
Willmore BattleShipNet
Üretici En İyi Yanıt

Thank you. I didn't know before about those modules. I am trying to attach files to "internal notes" not the record currently open neither work with internal notes attachments unfortunately :/.

0
Avatar
Vazgeç
Sudhir Arya (ERP Harbor Consulting Services)

What do you mean by internal notes?

Willmore BattleShipNet
Üretici

In Odoo chatter there is a link (next to "New Message") "Log an internal note". When clicked on "Log an internal note" the text box appears where I can write note, and there is also attachment button. When clicked on the attachment button then appears file choose window. Once I choose file it is immediately uploaded to the server as an attachment to that note. I would like to allow a user to drag and drop a file on the "Log an internal note" :) and once the file is dropped it should upload immediately. This would save users time because they will not have to browse to the file they would just drag and drop needed files. But "Drag and drop" is not supported in "Log an internal note" (in chatter), how to enable it? I tried with the source code above but files didn't upload, it's stuck :/

Avatar
Ujjwal Singh Baghel
En İyi Yanıt

Hi Willmore,
I am also stuck with the same problem.
Have you figured out the solution yet?
If yes, please help me out in this, I will be really grateful.

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
[SOLVED] enable field Discount at invoice line and vendor bill odoo 10 Çözüldü
discount odoo10 odoov10
Avatar
Avatar
2
Şub 25
8286
Extend view to fullscreen
ir.ui.view odoo10 odoov10
Avatar
Avatar
1
Eyl 20
8016
Odoo 10 create user menu (new menu in account)
odoo10 odoo10.0 odoov10
Avatar
0
Eki 17
3608
how to add a column in a list view
listview column odoo10 odoov10
Avatar
Avatar
Avatar
Avatar
Avatar
5
Eyl 19
13202
Dynamic Filtering - Filter records in "This Month" for example Çözüldü
filter_domain odoo10 odoo10.0 odoov10
Avatar
1
Eyl 18
239
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