Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

field value doesn't shows in the view

Odoberať

Get notified when there's activity on this post

This question has been flagged
7 Replies
19650 Zobrazenia
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
Zrušiť
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
Best Answer

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
Zrušiť
Avatar
Narayanamurthy
Best Answer

 

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
Zrušiť
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
Best Answer

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
Zrušiť
Rachid
Autor

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
Autor

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

Rachid
Autor

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
Autor

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

Rachid
Autor

I test that before & it doesnt work :'(

Rachid
Autor

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

Rachid
Autor

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
Best Answer

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
Zrušiť
Rachid
Autor

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
Autor

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

Avatar
Jagdish Panchal
Best Answer

Hi,

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

Thanks

0
Avatar
Zrušiť
Rachid
Autor

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
Autor

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

Avatar
Alcaline
Best Answer

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
Zrušiť
Avatar
Andre Leander
Best Answer

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
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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