Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Problem with calendar.event : bool have no attribute replace

Subscriure's

Get notified when there's activity on this post

This question has been flagged
calendarcalendar.eventreplaceboolodooV8
5455 Vistes
Avatar
Youri Lebarch

I extends class calendar_event for add status with statusbar. It's work perfectly when i update an event BUT when i tried to create i've a problem : 

Traceback (most recent call last):

File "/home/x/workspace/Odoo8/openerp/http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/x/workspace/Odoo8/openerp/http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "/home/x/workspace/Odoo8/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "/home/x/workspace/Odoo8/openerp/http.py", line 796, in __call__

return self.method(*args, **kw)

File "/home/x/workspace/Odoo8/openerp/http.py", line 396, in response_wrap

response = f(*args, **kw)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/web/controllers/main.py", line 949, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/web/controllers/main.py", line 941, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/cap_addons/cap_CRM/models/calendar_event.py", line 66, in create

res = super(calendar_event, self).create(cr, uid, vals, context=context)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/crm/calendar_event.py", line 36, in create

res = super(calendar_event, self).create(cr, uid, vals, context=context)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/calendar/calendar.py", line 1646, in create

res = super(calendar_event, self).create(cr, uid, vals, context=context)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/mail/mail_thread.py", line 377, in create

thread_id = super(mail_thread, self).create(cr, uid, values, context=context)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/api.py", line 336, in old_api

result = method(recs, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/models.py", line 4042, in create

record = self.browse(self._create(old_vals))

File "/home/x/workspace/Odoo8/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/api.py", line 462, in new_api

result = method(self._model, cr, uid, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/models.py", line 4214, in _create

recs.modified(self._fields)

File "/home/x/workspace/Odoo8/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/models.py", line 5608, in modified

spec += self._fields[fname].modified(self)

File "/home/x/workspace/Odoo8/openerp/fields.py", line 1414, in modified

spec = super(_Relational, self).modified(records)

File "/home/x/workspace/Odoo8/openerp/fields.py", line 908, in modified

target = env[field.model_name].search([(path, 'in', records.ids)])

File "/home/x/workspace/Odoo8/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/x/workspace/Odoo8/openerp/api.py", line 462, in new_api

result = method(self._model, cr, uid, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/calendar/calendar.py", line 1511, in search

res = self.get_recurrent_ids(cr, uid, res, args, order=order, context=context)

File "/home/x/workspace/Odoo8/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/calendar/calendar.py", line 1187, in get_recurrent_ids

result_data.append(self.get_search_fields(ev, order_fields))

File "/home/x/workspace/alpbureautique_openerp/openerp/addons/calendar/calendar.py", line 1155, in get_search_fields

sort_fields['sort_start'] = browse_event['display_start'].replace(' ', '').replace('-', '')

ttributeError: 'bool' object has no attribute 'replace'.



This error is raise when i call create() by super() and it's link with field "participant_without_owner"

My code : 
"

class calendar_event(osv.Model):

_inherit = 'calendar.event'

_columns = {

'cap_state':fields.selection(

[('open', 'Confirmed'),

('cancel', 'Cancelled'),

('pending', 'Pending'),

('done', 'Held')

], string='Status', track_visibility='onchange',

help='The status is set to Confirmed, when a case is created.\n'

'When the call is over, the status is set to Held.\n'

'If the callis not applicable anymore, the status can be set to Cancelled.'),

'participant_without_owner':fields.char(compute="_compute_participant",store=True),

}

_default = {

'cap_state':'open'

}

@api.depends('partner_ids', 'user_id')

def _compute_participant(self):

for record in self:

if record.user_id.partner_id in record.partner_ids:

participants = record.partner_ids - record.user_id.partner_id

chaine = str("")

for p in participants:

chaine = chaine + p.name + ", "

record.participant_without_owner = chaine

def done_event_in_tree(self, cr, uid, ids, context=None):

res = self.write(cr, uid, ids, {'cap_state': 'done'}, context)

return res

def create(self,cr, uid, vals, context=None):

import datetime as dt

if context is None:

context = {}

date_appel = datetime.strptime(vals['start_datetime'], '%Y-%m-%d %H:%M:%S')

print type(date_appel)

print type(dt.datetime.today())

if date_appel > dt.datetime.today():

vals['cap_state'] = 'open'

else:

vals['cap_state'] = 'done'

vals['participant_without_owner'] = ""

print vals

res = super(calendar_event, self).create(cr, uid, vals, context=context)

return res

"

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
How to pass query parameters in URL to the Odoo calendar module?
calendar calendar.event
Avatar
0
de juny 25
1625
Calendar Events - no notification for declined invitation
calendar calendar.event
Avatar
0
d’abr. 19
3954
[Solved]Odoo Client error when opening a calendar view
calendar odooV8
Avatar
0
de set. 16
6284
What are attendee, avatar_mode, & use_contacts in calendar model? Solved
calendar calendar.event
Avatar
Avatar
1
de febr. 16
7624
How does Calendar display user names?
calendar calendar.event
Avatar
Avatar
1
de febr. 16
9162
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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