Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Is a .py file necessary, if I only want to add an existing field to a view in code?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
viewsmodules.py.xml
1 Beantwoorden
4922 Weergaven
Avatar
Jeff Beidler

I'm working on my first OpenERP module.  (Woo hoo!)

All I really want to do is to add existing fields 'product_name' and 'product_code' (from product.supplierinfo) into View #233 (Product form view).  I'm talking about the Suppliers area that appears near the bottom of a product form view --> Procurements tab.  Developer mode tells me this area is the 'seller_ids' field from product.supplierinfo.

Since I'm not defining any new models or fields, do I still need to have a 'mymodule.py' file?  Or is a new .xml file for the view all I need?  If I still need a .py file, what do I put in it?

0
Avatar
Annuleer
Avatar
Lucio
Beste antwoord

Hi,

You don't need a "mymodule.py" file, but you do need a __iniit__.py and __openerp__.py files.

The former can be empty, is just to indicate that your folder (where you are creating your .xml and so on) is in fact a module.
In the __openerp__.py file yo need to add the xml as data:


 {
    'name': 'My Module',
    'version': '0.1',
    'author': 'You',
    'website': 'http://www.example.com',
    'depends': [
        'product',
    ],
    'description' : """
                    Added fields to suppliers tree of product form view
                    """,
    'data': ['your_view.xml',]
}

That's it!
Hope it helps, and welcome to OpenERP/Odoo!

1
Avatar
Annuleer
Jeff Beidler
Auteur

Cool, thanks. Now I just have to figure out how to modify one view that is displayed inside another!

Lucio

Take a look at sale_stock/sale_stock_view.xml line88, you can do something like that. Something like: <xpath expr="//field[@name='seller_ids']/tree/field[@name='field_of_sellers_tree_view']" postion="after"> for editing the tree form for example.

Jeff Beidler
Auteur

Where do you find the .xml files? I'm looking in the OpenERP directory, and don't see them.

gunnar

@Jeff: go to /opt/openerp/openerp-server/addons or /opt/odoo/odoo-server/addons. Inside of each Module folder you can find the xml files for each Module

Jeff Beidler
Auteur

Hmm... neither /opt/openerp nor /opt/odoo exist. I installed on CentOS with a pre-made install script. Not sure where it put its files. Can't find any directory references other than for startup and .conf files.

Jeff Beidler
Auteur

Found it! On my system, it is /usr/lib/python2.6/site-packages/openerp-7.0_20140804_231303-py2.6.egg/openerp/addons/sale_stock/sale_stock_view.xml Whew! That's a long one!

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Recommended way of changing frontend values Opgelost
views modules portal
Avatar
Avatar
1
jul. 23
4497
Error Element cannot be located in parent view
views modules error
Avatar
Avatar
1
mei 23
4850
[SOLVED] Custom module won't show view when clicking on menu item
views modules menu
Avatar
0
okt. 22
6308
change record lable in form view
views modules form
Avatar
Avatar
1
sep. 22
3376
Disable a view from custom module Opgelost
views modules customizing
Avatar
Avatar
1
feb. 16
8489
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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