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
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • 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

Field not added to model when module installed

S'inscrire

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

Cette question a été signalée
viewsmodulefields
1 Répondre
3578 Vues
Avatar
Sveng

Using v15EE

Have created a very simple module to add a field to the sales order form view. When I try install the module I get the following error:

Field "bay_fsmdesc" does not exist in model "sale.order"

View error context:
{'file': '/home/odoo/src/user/bay_salefsm_description/views/baysalesorderdescription.xml',
 'line': 3,
 'name': 'sale.order.form.sale.bay',
 'view': ir.ui.view(1568,),
 'view.model': 'sale.order',
 'view.parent': ir.ui.view(800,),
 'xmlid': 'bay_sale_order_customizations_form'}

Module code  and manifest

Manifest:

{'name': "bay_salefsm_description",
'summary': """        """,
'description': """    """,
'author': "sveng",
# Categories can be used to filter modules in modules listing# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml# for the full list'category': 'Uncategorized','version': '15.0.1.0','license': 'OPL-1',
# any module necessary for this one to work correctly'depends': ['sale_management', 'fieldservice', 'fieldservice_sale'],
# always loaded'data': ['views/baysalesorderdescription.xml',   # Add the modified view    ],# only loaded in demonstration mode#'demo': [#    'demo/demo.xml',#],'installable' : True,'application' :  False,
}

models:

from odoo import _, api, fields, models

from odoo.exceptions import ValidationError

classSaleOrder(models.Model):   _inherit="sale.order"
   bay_fsmdesc= fields.Char(string='FSM Order Description')

View:

xml version="1.0" encoding="UTF-8"?><odoo><recordid="bay_sale_order_customizations_form"model="ir.ui.view"><fieldname="name">sale.order.form.sale.bayfield><fieldname="model">sale.orderfield><fieldname="inherit_id"ref="sale.view_order_form"/><fieldname="arch"type="xml"><xpathexpr="//field[@name='partner_shipping_id']"position="after">    <fieldname="bay_fsmdesc"/>xpath>       field>   record>odoo>

0
Avatar
Ignorer
Sveng
Auteur

This is embarrassing ... although I had the .py file in the _init_ of the models folder ... I did not have the models folder in the root _init_

Grrr, apologies for posting such a simple fail! 

Avatar
Kiran K
Meilleure réponse

Hi  ​Sveng,

Ensure that the file is added to the init file.


After adding the field, restart the server for the changes to take effect.


In some cases, even after restarting the Odoo service, the old service instance might still be running or holding onto cached data. Stopping the service and then starting it again can ensure that you are working with a fresh service instance.

Hope it helps,
Kiran K

0
Avatar
Ignorer
Sveng
Auteur

Tx for that. Am running on Odoo.sh so the rebuild when adding module to source tree should take care of that right?

Have added the sale_order.py file in the models folder to the _init_.py file in that folder like this

from . import (sale_order,)

right from the start ... but still getting error

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é
Iterate over batch of dynamic fields in openerp Résolu
views fields
Avatar
Avatar
1
mars 15
6081
Wrong object when creating a dynamic view in OpenERP
views fields view
Avatar
Avatar
2
sept. 23
9232
how to change the type of a field in a model(a table) of the official module (hr) OpenERP
module fields model
Avatar
Avatar
1
juil. 22
8336
Add customer_rank and supplier_rank to partner form
views fields custom
Avatar
Avatar
2
mars 22
7569
E-Commerce Exploded View Module
views module ecommerce
Avatar
Avatar
1
janv. 21
8590
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