Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

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

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

field value doesn't shows in the view

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
7 Ответы
19643 Представления
Аватар
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
Аватар
Отменить
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...

Аватар
Andre Leander
Лучший ответ

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
Аватар
Отменить
Аватар
Narayanamurthy
Лучший ответ

 

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
Аватар
Отменить
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

Аватар
Med Said BARA
Лучший ответ

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
Аватар
Отменить
Rachid
Автор

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
Автор

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

Rachid
Автор

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
Автор

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

Rachid
Автор

I test that before & it doesnt work :'(

Rachid
Автор

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

Rachid
Автор

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 !

Аватар
le_dilem
Лучший ответ

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
Аватар
Отменить
Rachid
Автор

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
Автор

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

Аватар
Jagdish Panchal
Лучший ответ

Hi,

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

Thanks

0
Аватар
Отменить
Rachid
Автор

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
Автор

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

Аватар
Alcaline
Лучший ответ

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
Аватар
Отменить
Аватар
Andre Leander
Лучший ответ

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
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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 – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

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