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

Problem when fetching a data from a many2many field

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
jsoncontrollersodoopostman
1 Cevapla
4423 Görünümler
Avatar
Webmaster jr2

Good morning what happens is that I am developing a controller to bring some data from the field service module since I am developing a mobile application, the drawback is that when I call a many2many table I get the following error


"Expected singleton: fsm.person(865, 867)"


My code

class Reports(http.Controller): @http.route('/get_reports', type="json", auth='user') 

def get_all_reports(self): 

# Get all reports 

reports_rec = request.env['fsm.order'].search([]) 

reports = [] 

tabla = [] 

for x in reports_rec: 

Inicio = { 

'name': x.name, 

'id': x.id, 

'type': x.type.name, 

'template_id': x.template_id.name, 

'project_id': x.project_id.name, 

'project_task_id': x.project_task_id.name,

'priority': x.priority, 

'tag_ids': x.tag_ids.name, 

'centro_costos': x.centro_costos.name, 

'cajero': x.cajero, 

'person_id': x.person_id.name, 

'anotaciones': x.anotaciones, 

'tipo_unidad': x.tipo_unidad, 

'tdv': x.tdv } 

Descripcion = { 

'description': x.description, 

} 

Planificacion = {

 'Requisitos': [ { 

'category_ids': x.category_ids.name, 

'request_early': x.request_early, 

'request_late': x.request_late }], 

'Detalles del Horario': [ { 

'sheduled_date_start': x.scheduled_date_start, 

'sheduled_duration': x.scheduled_duration,

 'sheduled_date_end': x.scheduled_date_end }], } 

for y in x.person_ids.name: 

var = { 

'Solicitar Trabajadores': [ 

{ 

'name': y.name, 

'category_ids': y.category_ids.name,

 'phone': y.phone,

 'email': y.email } ] }

tabla.append(var)

reports.append(Inicio) 

reports.append(Descripcion) 

reports.append(Planificacion) 

reports.append(tabla)
data = {'status': 200, 'response': reports, 'message': 'Success', } 

return data

0
Avatar
Vazgeç
Avatar
Waleed Mohsen (CorTex IT Solutions)
En İyi Yanıt

You have this incorrect loop for y in x.person_ids.name: and it should be
for y in x.person_ids:

0
Avatar
Vazgeç
Webmaster jr2
Üretici

You were right but I still get the error what happens is that I want to bring these two fields or if more are added to a json-type controller
https://postimg.cc/njpWLcdj
because when I add that second field to the table I get the error of
"Expected singleton: fsm.person(865, 867)"

Waleed Mohsen (CorTex IT Solutions)

maybe the error showing by another code

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 redirect to some url in website from json type method in controller?
json controllers redirect odoo v13
Avatar
Avatar
Avatar
2
Haz 24
12109
How to redirect a controller from portal to fieldservice backend for users who are not backend users
controllers odoo
Avatar
Avatar
1
Haz 23
3796
how to solve " AttributeError: 'function' object has no attribute 'routing_type' " problem in Odoo
json odoo
Avatar
0
Tem 17
15390
How to parse a JSON i PYTHON with ODOOO9?
json odoo
Avatar
0
Oca 16
5045
Why does odoo use XML not JSON ? Çözüldü
xml json odoo
Avatar
Avatar
1
Mar 25
1332
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