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

In res_config.py why odoo cannot find a field that is already defined?

S'inscrire

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

Cette question a été signalée
settingsres_config
1 Répondre
6349 Vues
Avatar
hesham.elmahdy@odootec.com

I have been coding the reading for the last 3 days trying to find out what I am missing.

All I want to do is to add a config setting to the sale settings. The issue is that when I override the xml of setting page, Odoo cannot find the field.


Here is the error that I get:

 15-05-26 21:56:21,290 30095 INFO samy openerp.modules.loading: loading odootec_wh_count/odootec_res_config_view.xml
2015-05-26 21:56:21,321 30095 ERROR samy openerp.addons.base.ir.ir_ui_view: Field `group_qty_warning_on_selected_wh` does not exist

Error context:
View `sale settings`
[view_id: 716, xml_id: odootec_wh_count.odootec_view_sale_config, model: sale.config.settings, parent_id: 698]
2015-05-26 21:56:21,324 30095 INFO samy werkzeug: 127.0.0.1 - - [26/May/2015 21:56:21] "GET / HTTP/1.1" 500 -
2015-05-26 21:56:21,338 30095 ERROR samy werkzeug: Error on request:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
  File "/home/hesham/odoo/openerp/service/server.py", line 285, in app
    return self.app(e, s)
  File "/home/hesham/odoo/openerp/service/wsgi_server.py", line 216, in application
    return application_unproxied(environ, start_response)
  File "/home/hesham/odoo/openerp/service/wsgi_server.py", line 202, in application_unproxied
    result = handler(environ, start_response)
  File "/home/hesham/odoo/openerp/http.py", line 1290, in __call__
    return self.dispatch(environ, start_response)
  File "/home/hesham/odoo/openerp/http.py", line 1264, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 588, in __call__
    return self.app(environ, start_response)
  File "/home/hesham/odoo/openerp/http.py", line 1426, in dispatch
    ir_http = request.registry['ir.http']
  File "/home/hesham/odoo/openerp/http.py", line 345, in registry
    return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
  File "/home/hesham/odoo/openerp/modules/registry.py", line 339, in get
    update_module)
  File "/home/hesham/odoo/openerp/modules/registry.py", line 370, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/hesham/odoo/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/home/hesham/odoo/openerp/modules/loading.py", line 255, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/hesham/odoo/openerp/modules/loading.py", line 176, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/home/hesham/odoo/openerp/modules/loading.py", line 118, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/home/hesham/odoo/openerp/tools/convert.py", line 901, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/hesham/odoo/openerp/tools/convert.py", line 987, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/hesham/odoo/openerp/tools/convert.py", line 853, in parse
    self._tags[rec.tag](self.cr, rec, n, mode=mode)
  File "/home/hesham/odoo/openerp/tools/convert.py", line 763, in _tag_record
    id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/base/ir/ir_model.py", line 1050, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/base/ir/ir_ui_view.py", line 282, in write
    context)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/api.py", line 363, in old_api
    result = method(recs, *args, **kwargs)
  File "/home/hesham/odoo/openerp/models.py", line 3774, in write
    self._write(old_vals)
  File "/home/hesham/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/home/hesham/odoo/openerp/models.py", line 3945, in _write
    recs._validate_fields(vals)
  File "/home/hesham/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/models.py", line 1270, in _validate_fields
    raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Error details:
Field `group_qty_warning_on_selected_wh` does not exist

Error context:
View `sale settings`
[view_id: 716, xml_id: odootec_wh_count.odootec_view_sale_config, model: sale.config.settings, parent_id: 698]" while parsing /home/hesham/odootec-projects/odootec-repo/odootec_wh_count/odootec_res_config_view.xml:4, near
<record id="odootec_view_sale_config" model="ir.ui.view">
                <field name="name">sale settings</field>
                <field name="model">sale.config.settings</field>
                <field name="inherit_id" ref="sale.view_sales_config"/>
                <!--<field name="priority" eval="16"/>-->
                <field name="arch" type="xml">
                        <xpath expr="//div[@name='warehouse_features']" position="inside">
                        <div>
                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                            <field name="group_qty_warning_on_selected_wh" class="oe_inline"/>
                            <label for="group_qty_warning_on_selected_wh"/>
                        </div>
                    </xpath>
                </field>
            </record>


This is the res_config.py file:

 from openerp import fields, models, _

class sale_quote_settings(models.TransientModel):
_name = 'sale_quote.config.settings'
_inherit = 'sale.config.settings'

group_qty_warning_on_selected_wh = fields.Boolean(_('Qty warning on selected warehouse'),
group="", implied_group="",
required=True, default=True,
help=_("To restrict product count to the stock location of selected warehouse only, when making a quotation"))



and the res_config_view.xml file:



<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="odootec_view_sale_config" model="ir.ui.view">
<field name="name">sale settings</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.view_sales_config"/>
<!--<field name="priority" eval="16"/>-->
<field name="arch" type="xml">
<xpath expr="//div[@name='warehouse_features']" position="inside">
<div>  
<field name="group_qty_warning_on_selected_wh" class="oe_inline"/>
<label for="group_qty_warning_on_selected_wh"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>



What am I missing?
0
Avatar
Ignorer
Avatar
Emipro Technologies Pvt. Ltd.
Meilleure réponse

Hi,

you have to write down your class as like below.


class sale_quote_settings(models.TransientModel):

_name = 'sale.config.settings' # Here is an issue. instead of 'sale_quote.config.settings'

_inherit = 'sale.config.settings'

group_qty_warning_on_selected_wh = fields.Boolean(_('Qty warning on selected warehouse'),

group="", implied_group="",

required=True, default=True,

help=_("To restrict product count to the stock location of selected warehouse only, when making a quotation"))


I think you got and issue.

2
Avatar
Ignorer
hesham.elmahdy@odootec.com
Auteur

Thanks. I did, then I get this error when I try to open the settings>configuration>sales: File "/home/hesham/odoo/openerp/addons/base/res/res_config.py", line 489, in ref mod, xml = xml_id.split('.', 1) ValueError: need more than 1 value to unpack

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é
How can I save/load my own configuration/settings Résolu
configuration settings res_config
Avatar
Avatar
Avatar
Avatar
6
avr. 23
40318
Override res_config field
settings v7 res_config
Avatar
Avatar
1
mars 15
5679
USUARIO DE LECTURA - ODOO
settings
Avatar
Avatar
Avatar
2
sept. 25
725
Fiscal localizations
settings
Avatar
Avatar
2
avr. 25
10952
Where is the "Translated Terms" Menu in Odoo 16? Résolu
settings
Avatar
Avatar
Avatar
Avatar
Avatar
5
mars 25
21099
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