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

field value doesn't shows in the view

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
7 Antwoorden
19636 Weergaven
Avatar
Rachid

hello I found a problem with the stock module I want to add some fields the data are stored in the database but not displayed in the view!!!


__init__.py

import test

openerp.py

{
    "name" : "Test",
    "version" : "1.0",
    "category" : "",
    'complexity' : "normal",
    "author" : "xxxxxx",
    "website" : "www.you.com",
    "depends" : ["stock"],
    "summary" : "Test",
     "description" : """ Test """,
    "data" : ['test_view.xml'],
    "application": False,
    "installable": True
}

test.py

from openerp.osv import fields, osv

class stock_picking_out(osv.osv):
    _inherit = 'stock.picking.out'
    _columns = {
             'test': fields.char('Test Field', size=8, select=True, states={'done': [('readonly', True)]}, domain=[('type', '=', 'out')]),
}

test_view.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_picking_out_form_test" model="ir.ui.view">
            <field name="name">stock.picking.out.form.test</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="stock.view_picking_out_form" />
            <field name="arch" type="xml">
            <field name="partner_id" position="after">
              <field name="test" placeholder="e.g. [0-9][a-zA-Z]" />
            </field>
            </field>
        </record>
    </data>
</openerp>
0
Avatar
Annuleer
Andre Leander

Finally I now to fix this. This is OpenERP bug (ref: lp996816). You must add the new field in two model by inheriting stock.picking & stock.picking.out. See in sale_stock module > stock.py (on last line) there is FIXME comment. Add that new field in new inherit stock.view_picking_out_form with model stock.picking.out. Thx all...

Avatar
Andre Leander
Beste antwoord

I have same problem. My friend try deleting all .pyc file from folder addons and it success to display field value (before did not show). But I tried again in my module, it didn't work. I think there is a problem in .py file or osv file.

0
Avatar
Annuleer
Avatar
Narayanamurthy
Beste antwoord

 

need to create the field in both "stock_picking_out" and "stock_picking"

 

Hi rachid,

You Can try this.....

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_picking_out_form_test" model="ir.ui.view">
            <field name="name">stock.picking.out.form.test</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="stock.view_picking_form"/>
            <field name="arch" type="xml">

               <xpath expr="//group/group/field[@name='partner_id']" position="after">

                      <field name="test" placeholder="e.g. [0-9][a-zA-Z]"/>

              </xpath>

           </field>

</record>

</data>

</openerp>

0
Avatar
Annuleer
Andre Leander

I' ve tried your code. But still do not display the value. If I save, the value insert into database but do not show in view (I can see label but not the value). In my tree view, it also do not show up.

Narayanamurthy

Problem is you Have created field only in "stock.picking.out" u cannot save data in that, so need to create field in "stock.picking" also.... try this and it defnetly works

Avatar
Med Said BARA
Beste antwoord

Hi;

I think you should add field name="priority" eval="12" to your form according to this.

Maybe, you will have to change the eval value from 12 to another value.

Go under Settings ---> Technical ----> User Interface , open Views and filter by Stock, to see all views related to stock. There you can see the priority of the views.

Another question: did you checked if the field ' test' is created in the table stock_picking

Last, i think your class should inherit from stock.picking and not stock.picking.out

stock.view_picking_form

Try as follow to see if it works:

Don't use the xpath:

      field name="partner_id" position="after"

      field name="test" placeholder="e.g. [0-9][a-zA-Z]"

In your view you are using the object (Model) stock.picking.out, so i think you must inherit from stock.view_picking_out_form:

    <field name="inherit_id" ref="stock.view_picking_out_form"/>

Try with and without xpath.

Also, if you are using V7.0, Remove

       <field name="type">form</field>

from your form view.

I've tested on my side and it's working (without xpath).

put this in your __init__.py file: import test (in my case i've named the py file as test.py), and in your __openerp__.py file put

"data" : ['test_view.xml'], Of course! don't forget "depends" : ["stock"], as stated by le_dilem

test-rachid

Give it a try, and keep us informed.

Good luck.

Here after the files i used:

__init__.py

import test

__openerp__.py

{
"name" : "Test", "version" : "1.0", "category" : "", 'complexity' : "normal", "author" : "xxxxxx", "website" : "www.you.com", "depends" : ["stock"], "summary" : "Test", "description" : """ Test """,

"data" : ['test_view.xml'],
"application": False,
"installable": True

}

test.py

from openerp.osv import fields, osv

 class stock_picking_out(osv.osv):

          _inherit = 'stock.picking.out'

          _columns = {
                   'test': fields.char('Test Field', size=8, select=True, states={'done': [('readonly', True)]}, domain=[('type', '=', 'out')]),
}

test_view.xml

     <?xml version="1.0" encoding="utf-8"?>
              <openerp>
                    <data>
                       <record id="view_picking_out_form_test" model="ir.ui.view">
                            <field name="name">stock.picking.out.form.test</field>
                            <field name="model">stock.picking.out</field>
                            <field name="inherit_id" ref="stock.view_picking_out_form" />
                            <field name="arch" type="xml">
                               <field name="partner_id" position="after">
                                 <field name="test" placeholder="e.g. [0-9][a-zA-Z]" />
                               </field>
                            </field>
                        </record>
                    </data>
              </openerp>
0
Avatar
Annuleer
Rachid
Auteur

no change, same problem , I tryed eval="10" and eval="15" too with no changes :(

Med Said BARA

What's the content of your openerp-server.log. Do you get any error message during the install process of the module? Did you restarted the server ?

Rachid
Auteur

yes I restarted the server with test modul as update there's no errors in log

Rachid
Auteur

the priority of pickin_out is 16 I tryed 15 & 17 with no result the values is stored in the database but not displayd

Med Said BARA

Is it stored in the stock_picking table?

Rachid
Auteur

yes, when I save the view the data is stored in the table stock_picking

Rachid
Auteur

I test that before & it doesnt work :'(

Rachid
Auteur

I copied all your code, & the problem doesn't resolved :s

Rachid
Auteur

med said did the value apear in the field ?

Med Said BARA

Yes, the value appears in the field. Rachid, if you still encounter a problem there is probably some details in your openerp-server.log or in your postgres.log !

Avatar
le_dilem
Beste antwoord

I tested the code. like this

do not forget in your file __ openerp__.py add the 'depends' : ['stock'],

 from openerp.osv import fields, osv

    class stock_picking_out(osv.Model):
        _inherit = 'stock.picking.out'

        _columns = {
            'test': fields.char('Test Field', size=8, select=True, states={'done': [('readonly', True)]}, domain=[('type', '=', 'out')]),
        }

    <?xml version="1.0" encoding="utf-8"?>
    <openerp>
      <data>
            <record id="view_picking_out_form_test" model="ir.ui.view">
            <field name="name">stock.picking.out.form.test</field>
            <field name="type">form</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="stock.view_picking_form"/>
            <field name="arch" type="xml">
                <field name="partner_id" position="after">
                    <field name="test" placeholder="e.g. [0-9][a-zA-Z]"/>
                </field>
            </field>
            </record>
      </data>
    </openerp>
0
Avatar
Annuleer
Rachid
Auteur

same result, the field doesn't display the value :s

Med Said BARA

I think that ( view name: stock.picking.out.form) stock.view_picking_out_form (external ID) inherit from (view name name: stock.picking.form) stock.view_picking_form (external ID).

Rachid
Auteur

they're no deference. I want just the values to be displayed

Avatar
Jagdish Panchal
Beste antwoord

Hi,

Refer sale_stock module - stock.py line 147 - 152 - stock_view.xml line no 52 -61

Thanks

0
Avatar
Annuleer
Rachid
Auteur

I didn't understand what do you mean ?

Jagdish Panchal

check module name sale_stock(see file stock.py line no 147 to 152 and in stock_view.xml line no 52 to 61) from addons. there is field added in stock.picking object

Rachid
Auteur

same as the code I used no deference, the view doesn't display the data

Avatar
Alcaline
Beste antwoord

put also your 'test': fields.char('Test Field', size=8, select=True, states={'done': [('readonly', True)]}, domain=[('type', '=', 'out')]), in stcok.picking inherited class.

0
Avatar
Annuleer
Avatar
Andre Leander
Beste antwoord

I have same problem. My friend try deleting all .pyc file from folder addons and it success to display field value (before did not show). But I tried again in my module, it didn't work. I think there is a problem in .py file or osv file.

0
Avatar
Annuleer
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
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