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

How to add country, state and file attachment in my website form in odoo13, not by drag & drop?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
Odoo13.0Odoo13odoo13odoo13CE
3 Cevaplar
6023 Görünümler
Avatar
Aishwarya

This is how my form looks

<? xml version = "1.0" encoding = "UTF-8"?>

<odoo>

    <template id = "tmp_customer_form" name = "Partner Form">

        <t t-call = "website.layout">

            <div id = "wrap" class = "alumni">

                <div class = "container">

                    <div class = "col-md-12">

                        <form action = "/ customer / form / submit">

                            <table border = "0" width = "100%" class = "table-sign">

                        <tbody>

                            <tr>

                                <th colspan = "3" style = "color: #ffffff;"> Identify Yourself </th>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "name"> Alumni Name (Full) </label>

                                </ Td>

                                <td width = "2%" align = "center">

                                    <B>: </ b>

                                </ td>

                                <td width = "77%">

                                    <input type = "text" name = "name" id = "name" size = "40" required = "" />

                                </ td>

                            </ tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "date"> Date Of Birth [DD / MM / YY] </label>

                                </ td>

                                <td width = "2%" align = "center" valign = "top">

                                    <B>: </ b>

                                </ Td>

                                <td width = "77%" valign = "top">

                                    <input type = "date" name = "date" size = "10" maxlength = "10" required = "" />

                                </ td>

                            </ Tr>

                           

<Tr>

                                <td width = "21%"> </td>

                                <td width = "2%" align = "center">

                                    <B>: </ b>

                                </ Td>

                                <td width = "77%">

                                    <input type = "text" name = "my_teachers1" id = "my_teachers1" size = "20" />

                                </ td>

                            </ tr>

                            <tr>

                                <th colspan = "3" style = "color: #ffffff;"> Contact Details </th>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "city"> City </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </ td>

                                <td width = "77%">

                                    <input type = "text" name = "city" id = "city" size = "30" required = "" />

                                </ td>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "state_id"> State </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </ td>

                                <td width = "77%">

                                    <input type = "text" name = "state_id" id = "state_id" size = "30" required = "" />

                                </td>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "country_id"> Country </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </td>

                                <td width = "77%">

                                    <input type = "text" name = "country_id" id = "country_id" size = "30" required = "" />

                                </td>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "phone"> Mobile No. </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </td>

                                <td width = "77%">

                                    <input type = "text" name = "phone" id = "phone" />

                                </td>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "email"> Email </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </td>

                                <td width = "77%">

                                    <input type = "email" name = "email" id = "email" size = "30" />

                                </td>

                               <td width = "2%" align = "center">

                                    <b>: </ b>

                                </td>

                                <td width = "77%">

                                    <textarea name = "about" id = "about" rows = "5" cols = "50"> </textarea>

                                </td>

                            </tr>

                            <tr>

                                <td width = "21%">

                                    <label for = "image_1920"> Upload Photo </label>

                                </td>

                                <td width = "2%" align = "center">

                                    <b>: </ b>

                                </td>

                                <td width = "77%">

                                    <input type = "file" name = "image_1920" id = "image_1920" />

                                </td>

                            </tr>

                            <tr>

                                <td width = "21%"> </td>

                                <td width = "2%" align = "center">

                                    <b> </ b>

                                </td>

                                <td width = "77%">

                                    <input type = "submit" value = "Submit"> </input>

                                </dd>

                            </tr>

                        </tbody>

                    </table>

                 </ form>

                </div>

              </div>

          </t>

    </template>


    <template id = "tmp_customer_form_success" name = "Customer Form Successfully Submitted">

        <t t-call = "website.layout">

            <div id = "wrap">

                <div class = "container">

                    <div class = "col-md-12">

                        <div class = "alert alert-success">

                            <p> Thank You! </ P>

                            <p> Your form has registered successfully </p>

                        </div>

                    </ div>

                </div>

            </ div>

        </ t>

    </ template>

</ odoo>

Here is my controller.py

from odoo import http

from odoo.http import request

class AlumniForm (http.Controller):

    #mention class name

    @ http.route (['/ customer / form'], type = 'http', auth = "public", website = True)

    #mention a url for redirection.

    #define the type of controller which in this case is 'http'.

    #mention the authentication to be either public or user.

    def alumni_form (self, ** post):

    #create method

    #this will load the form webpage

        return request.render ("sample.tmp_customer_form", {})

    @ http.route (['/ customer / form / submit'], type = 'http', auth = "public", website = True)

    #next controller with url for submitting data from the form #

    def alumni_form_submit (self, ** post):

        partner = request.env ['res.partner']. create ({

            'name': post.get ('name'),

            'date': post.get ('date'),

            'city': post.get ('city'),

            'state_id': post.get ('state_id'),

            'country_id': post.get ('country_id'),

            'phone': post.get ('phone'),

            'email': post.get ('email'),

            'image_1920': post.get ('image_1920'),

        })

        vals = {

            'partner': partner,

        }

        #inherited the model to pass the values ​​to the model from the form #

        return request.render ("sample.tmp_customer_form_success", vals)

Now, the coutry, state & the attachment file are not linking to the backend, what should I do?

0
Avatar
Vazgeç
Sehrish

File Attachment or Upload: http://learnopenerp.blogspot.com/2019/01/add-attachement-file-from-odoo-website.html

Aishwarya
Üretici

Have you worked in that? It's not working for me

Avatar
Mustufa Rangwala
En İyi Yanıt

Hello,

You can try:

=======

<div t-attf-class="col-lg-6 o_website_form_custom_attchments">

                                            <label class="control-label" for="Attachments" >Attach Files</label>

                                            <input type="file" class="form-control o_website_form_input" name="attachment" multiple='multiple'/>

                                            <div>

                                                <label style="color:grey; font-size:12px;" >Multiple files Attachments</label>

                                            </div>

                                        </div>

=======

in controller you can write:

attachment_list = request.httprequest.files.getlist('attachment')

            for image in attachment_list:

                if post.get('attachment'):

                    attachments = {

                               'res_name': image.filename,

                               'res_model': 'machine.repair.support',

                               'res_id': support,

                               'datas': base64.encodestring(image.read()),

                               'type': 'binary',

                               # 'datas_fname': image.filename, odoo13

                               'name': image.filename,

                           }

                    attachment_obj = http.request.env['ir.attachment']

                    attach = attachment_obj.sudo().create(attachments)

====

Regards,

Mustufa Rangwala (Probuse)


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
How to put domain filter on One2Many Field on a from Çözüldü
Odoo13.0 Odoo13 odoo13 odoo13CE
Avatar
1
Kas 21
4561
Having trouble installing the website module in a fresh DB
Odoo13.0 odoo13.0 Odoo13 odoo13 odoo13CE
Avatar
0
Kas 21
3247
Database problem
Odoo13.0 odoo13.0 Odoo13 odoo13 odoo13CE
Avatar
Avatar
Avatar
Avatar
8
Mar 20
10372
Error with search content in elearning platform of Odoo 13
Odoo13.0 odoo13.0 Odoo13 odoo13 odoo13CE
Avatar
0
Eki 19
3856
Error with newsletter block of website builder in ODOO 13
Odoo13.0 odoo13.0 Odoo13 odoo13 odoo13CE
Avatar
0
Eki 19
4569
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