Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Uncaught TypeError: value.split is not a function

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
functionerrornotsplitodoo11
2 Réponses
17891 Vues
Avatar
Chaanto
Traceback:
TypeError: value.split is not a function
    at Class._getDisplayName (http://localhost:8099/web/content/417-9eb0f92/web.assets_backend.js:1036:101)
    at http://localhost:8099/web/content/417-9eb0f92/web.assets_backend.js:1041:219
    at Function._.map._.collect (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:13:270)
    at Object.<anonymous> (http://localhost:8099/web/content/417-9eb0f92/web.assets_backend.js:1041:186)
    at Object.<anonymous> (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:802:681)
    at fire (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:796:299)
    at Object.fireWith [as resolveWith] (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:801:198)
    at Object.deferred.<computed> [as resolve] (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:803:56)
    at Object.<anonymous> (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:3869:358)
    at Object.<anonymous> (http://localhost:8099/web/content/383-91f685c/web.assets_common.js:802:681)



CODE :

class HRContributionTechIndustry(models.Model): _name = 'hr.contribut.tech' _description = 'Contributions to Tech Industry' tech_contribut = fields.Selection([ ('commi', 'International/National Tech Committees'), ('judge', 'Judge/Assessor/Mentor/Author/Speaker of Tech-related Awards, Programmes or Events'), ], string='Tech Industry') name_commi = fields.Char(string='Name of Tech-related Committee', required=False) name_judge = fields.Char(string='Judge/Assessor/Mentor/Author/Speaker of Tech-related Awards, Programmes or Events', required=False) position_judge = fields.Selection([ ('judge', 'Judge'), ('assessor', 'Assessor'), ('author', 'Author'), ('mentor', 'Mentor'), ('speaker', 'Speaker'), ('other', 'Others') ],string='Position') position_commi = fields.Selection([ ('chairman', 'Chairman'), ('cmember', 'Committe Member'), ('other', 'Others') ],string='Position') please_specify = fields.Char('Please Specify') period_start =fields.Date('Start Date') period_end =fields.Date('End Date') @api.model def name_get(self): for select in self : if select.tech_contribut == 'commi' : res = [] for rec in self : name = rec.name_commi res.append((rec.id, name)) return res else : res = [] for rec in self : name = rec.name_judge res.append((rec.id, name)) return res



XML >>>

record model="ir.ui.view" id="hr_contributtech_form_view"> <field name="name">hr.contribut.tech.form</field> <field name="model">hr.contribut.tech</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Contributions to Tech Industry"> <sheet> <group> <field name="tech_contribut" required='1'/> <field name="name_commi" attrs="{'invisible': [('tech_contribut', '!=', 'commi')], 'required': [('tech_contribut', '=', 'commi')]}"/> <field name="name_judge" attrs="{'invisible': [('tech_contribut', '!=', 'judge')], 'required': [('tech_contribut', '=', 'judge')]}"/> <field name="position_judge" attrs="{'invisible': [('tech_contribut', '!=', 'judge')], 'required': [('tech_contribut', '=', 'judge')]}"/> <field name="position_commi" attrs="{'invisible': [('tech_contribut', '!=', 'commi')], 'required': [('tech_contribut', '=', 'commi')]}"/> <field name="please_specify" attrs="{'invisible': [('position_judge', '!=', 'other')], 'required': [('position_judge', '=', 'other')]}"/> <field name="please_specify" attrs="{'invisible': [('position_commi', '!=', 'other')], 'required': [('position_commi', '=', 'other')]}"/> <field name="period_start" required='True'/> <field name="period_end" required='1'/> </group> </sheet> </form> </field> </record> <record id="hr_contributtech_search_view" model="ir.ui.view"> <field name="name">hr.contribut.tech.search</field> <field name="model">hr.contribut.tech</field> <field name="arch" type="xml"> <search string="Event Name"> <field name="name_commi"/> <field name="name_judge"/> </search> </field> </record> <record model="ir.actions.act_window" id="action_hr_contributtech"> <field name="name">Contributions to Tech Industry</field> <field name="type">ir.actions.act_window</field> <field name="res_model">hr.contribut.tech</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> <field name="view_id" ref="hr_contributtech_tree_view"/> <!--<field name="search_view_id" ref="hr_contributtech_search_view"/>--> </record> <menuitem action="action_hr_contributtech" id="menu_hr_contributtech" parent="menu_participant_config" sequence="15"/>

0
Avatar
Ignorer
Yenthe Van Ginneken (Mainframe Monkey)

Update your code to the latest version. If the issue is still here then please report it at https://github.com/odoo/odoo

Avatar
Jignesh Mehta
Meilleure réponse

Hello Chaanto,


Please try below code:

@api.multi
def name_get(self):
    result = []
    for select in self:
        if select.tech_contribut == 'commi' :
            name = rec.name_commi
        else:
            name = rec.name_judge
        result.append((select.id, name))
    return result


Hope it will works for you.

Thanks,

1
Avatar
Ignorer
Chaanto
Auteur

Hello Jignesh Mehta,

i already tried it before but it still got an error.

Uncaught TypeError: Cannot read property 'split' of undefined

Avatar
Janbaz Aga
Meilleure réponse

Hello Chaanto,
    This issue is because in the  name  you are not using type string

@ api.multi
def name_get (self):
    result = []
    for select in self:
        if select.tech_contribut == 'commi':
            name = rec.name_commi
        else:
            name = rec.name_judge
        result.append ((select.id, name)) # In this 'name' field should be string
    return result

Please try the above code It will works
Thanks

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Uncaught TypeError: value.split is not a function Résolu
function error not split odoo11
Avatar
Avatar
Avatar
3
déc. 19
14981
"The character encoding of the HTML document was not declared" when connecting to odoo11 server
error odoo11
Avatar
0
nov. 21
4064
Error: The field `effective_date` does not exist - odoo 11
error odoo11
Avatar
Avatar
1
nov. 19
5825
Odoo Server Error "unable to create thread pipe"
error reporting odoo11
Avatar
0
janv. 22
4903
AttributeError: 'list' object has no attribute 'get'
error docker odoo11
Avatar
Avatar
1
août 19
13783
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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