Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Problem with calendar.event : bool have no attribute replace

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
calendarcalendar.eventreplaceboolodooV8
5343 Visninger
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
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
How to pass query parameters in URL to the Odoo calendar module?
calendar calendar.event
Avatar
0
jun. 25
1496
Calendar Events - no notification for declined invitation
calendar calendar.event
Avatar
0
apr. 19
3899
[Solved]Odoo Client error when opening a calendar view
calendar odooV8
Avatar
0
sep. 16
6154
What are attendee, avatar_mode, & use_contacts in calendar model? Løst
calendar calendar.event
Avatar
Avatar
1
feb. 16
7547
How does Calendar display user names?
calendar calendar.event
Avatar
Avatar
1
feb. 16
9065
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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