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

The domain does not work in a smart button

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
domain_filterv15smartbutton
3200 Görünümler
Avatar
José Antonio Rojas
Hello,
I'm trying to insert a smart button but I'm having problems using the domain (filter) as it directs me to a blank model, when I try to direct it to the model related to the name.
I hope you can help me, thank you very much.

.py

class Agenda_citas (models.Model):
_name = 'agendacitas'
_inherit =['mail.thread','mail.activity.mixin']
_description = "Agenda y estructura de el modulo de citas "
state = fields.Selection(string="Estado",
selection=[('ag', 'Agendada'),
('co', 'Confirmada'),
('ca', 'Cancelada'),
('re', 'Reprogramada')])
name = fields.Many2one(
comodel_name = 'res.partner',
string = 'Paciente'

)
inicio_cita = fields.Datetime (
string = 'Fecha inicio',
required=True,
default=fields.Date.today
)
final_cita = fields.Datetime (
string = 'Fecha Fin',
readonly=False,
default = lambda self: fields.Datetime.today() + timedelta(minutes=20),
compute='_compute_final_cita',
store = True,
)
duracion_cita = fields.Float(
'Duración',
compute='_compute_duration',
store=True,
readonly=False
)
doctor_base =fields.Many2one(
comodel_name = 'res.partner',
string = 'Doctor Tratante'

)
referencia = fields.Many2one(
comodel_name = 'res.partner',
string = 'Referencia'
)

observaciones_cita = fields.Text(string="Observaciones")
motivo = fields.Char(string="Motivo de Consulta")
#doctor_clinica = fields.Many2one(
# comodel_name = 'res.partner',
#string = 'doctor que atiende' )

@api.depends('inicio_cita' , 'final_cita')
def _compute_duration(self):
for event in self:
event.duracion_cita = self._get_duracion_cita(event.inicio_cita, event.final_cita)
@api.depends('inicio_cita', 'duracion_cita')
def _compute_final_cita(self):
# stop and duration fields both depends on the start field.
# But they also depends on each other.
# When start is updated, we want to update the stop datetime based on
# the *current* duration. In other words, we want: change start => keep the duration fixed and
# recompute stop accordingly.
# However, while computing stop, duration is marked to be recomputed. Calling `event.duration` would trigger
# its recomputation. To avoid this we manually mark the field as computed.
duration_field = self._fields['duracion_cita']
self.env.remove_to_compute(duration_field, self)
for event in self:
# Round the duration (in hours) to the minute to avoid weird situations where the event
# stops at 4:19:59, later displayed as 4:19.
event.final_cita = event.inicio_cita and event.inicio_cita + timedelta(seconds =round((event.duracion_cita or 1.0) * 60))

def _get_duracion_cita(self, inicio_cita, final_cita):
""" Get the duration value between the 2 given dates. """
if not inicio_cita or not final_cita:
return 0
duracion_cita = (final_cita - inicio_cita).total_seconds() / 60
return round(duracion_cita, 2)

def action_abrir_expediente (self):
return {
'type': 'ir.actions.act_window',
'name': 'Notas Médicas',
'res_model': 'res.partner',
'domain': [('name','=', self.id)],
'view_mode': 'form',
'target': 'current',
}

.xml

 
Agenda de Citas
agendacitas











Agendar Cita Paciente






domain = "[('es_convenio', '=', True)]"
options="{'no_create':True, 'no_open': True}"
/>





domain = "[('es_medico', '=', True)]"
options="{'no_create':True, 'no_open': True}"
/>


Observaciones



placeholder = 'Observaciones'
nolabel="1"/>












Vista de arbol Citas
agendacitas







widget="badge"
decoration-warning = "state =='re'"
decoration-success ="state == 'co'"
decoration-danger = "state == 'ca'"
decoration-info = "state =='ag'">




Thanks


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
odoo15ce domain many2one based on parent model Çözüldü
domain_filter v15
Avatar
Avatar
2
Kas 22
2996
add smart buttons Çözüldü
v15 smartbutton
Avatar
Avatar
Avatar
Avatar
3
Eki 22
13659
Defining a domain for an automated action with two variables in Odoo 15 Çözüldü
domain domain_filter AutomatedActions v15
Avatar
Avatar
1
Oca 23
4002
how to i get active id Çözüldü
saleorder active_id v15 smartbutton
Avatar
Avatar
1
Haz 22
13562
Prevent navigation if records are not save
v15
Avatar
Avatar
Avatar
2
Eki 25
3040
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