Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

The domain does not work in a smart button

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
domain_filterv15smartbutton
3271 Rodiniai
Portretas
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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
odoo15ce domain many2one based on parent model Solved
domain_filter v15
Portretas
Portretas
2
lapkr. 22
3036
add smart buttons Solved
v15 smartbutton
Portretas
Portretas
Portretas
Portretas
3
spal. 22
13894
Defining a domain for an automated action with two variables in Odoo 15 Solved
domain domain_filter AutomatedActions v15
Portretas
Portretas
1
saus. 23
4096
how to i get active id Solved
saleorder active_id v15 smartbutton
Portretas
Portretas
1
birž. 22
13708
Prevent navigation if records are not save
v15
Portretas
Portretas
Portretas
2
spal. 25
3191
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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