Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Real Estate
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    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
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

Problem with very simple module on account.invoice extension

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
developmentv7
3 Відповіді
10604 Переглядів
Аватар
Angela

Hi, this is a simple issue on a simple example (with all data provided here). I'm using OpenERP 7.0-20130212-002145

I've created a very simple module as shown below (it adds one field named dtc_dc_ident to account.invoice object and view), and when I install it all goes fine, but when I update it (with no change at all) I get the following error (in the server log file):

2013-02-13 18:17:22,721 1448 ERROR test7 openerp.osv.orm: Can't find field 'dtc_dc_ident' in the following view parts composing the view of object model 'account.invoice':

  • a_test_inherit.account.invoice.form

If I comment the line <field name="dtc_dc_ident" required="1"/> it works fine (and the field dtc_dc_ident is visible in the account.invoice object model)

This problem only arises on account.invoice, for example on hr.holidays all is OK.

Here is the module structure (4 files):

a_test

__init__.py __openerp__.py a_test_account_invoice.py a_test_account_invoice.xml

Here is the content of each file :

__init__.py

import a_test_account_invoice

__openerp__.py

{
"name" : "short description : a_test",
"version" : "1.0",
"author" : "Test DTC",
"website" : "none",
"category" : "Generic Modules/Others",
"depends" : ["base", "account" ],
"description" : "Description : A Test  module",
"init_xml" : ["a_test_account_invoice.xml", ],
"demo_xml" : [],
"update_xml" : [],
"active": False,
"installable": True,
"application": True,
}

a_test_account_invoice.py

from osv import fields, osv
import os
import time
import pooler
import codecs
import datetime
import string

from tools.translate import _
class account_invoice(osv.osv):
  _name = 'account.invoice'
  _inherit = 'account.invoice'
  _description = 'Invoice'
  _columns = {
    'dtc_dc_ident': fields.char('Identifiant DC', required=False, size=32),
  }
account_invoice()

a_test_account_invoice.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="a_test_inherit_invoice_form" model="ir.ui.view">
<field name="name">a_test_inherit.account.invoice.form</field>
<field  name="inherit_id"  ref="account.invoice_form"/>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="dtc_dc_ident" required="1"/>
</field>
</field>
</record>

</data>
</openerp>
0
Аватар
Відмінити
Angela
Автор

Not sure I'm allowed to push my post back up in this way... but I would like it if someone could test this and confirm what I get...

Thanks

Antonin Bourguignon (abo)

No, this is not a good practice. Although I converted your "answer" into a comment.

Аватар
Juanjo Algaz
Найкраща відповідь

Maybe you can change:

"init_xml" : ["a_test_account_invoice.xml", ],

by:

"update_xml" : ["a_test_account_invoice.xml", ],

0
Аватар
Відмінити
Аватар
Angela
Автор Найкраща відповідь

Try to :

uninstall your module
restart your server OpenERP
install your module

I had the same problem and it's the only one solution i found. Tell me if it work.

Yes, this will work, but this doesn't solve my issue, because normally you can update a module without uninstalling it (and restarting the server is only in case you change the python code). Besides, the above example works perfectly if you simply replace account.invoice with hr.holidays (and adapt a little)... so I'm sure it's related to something specific with account.invoice.

ybe you can change:

"init_xml" : ["a_test_account_invoice.xml", ],

by:

"update_xml" : ["a_test_account_invoice.xml", ],

I'd tested this already... but I'll test again just to see.

Thanks for your input in all cases, I'll be back after a few more tests.

0
Аватар
Відмінити
Angela
Автор

Well, I've done the above tests and it performs as I expected.... indeed, uninstall and reinstall works fine, but this isn't right, upgrade should work too.

Changing using update instead of init didn't change anything....

Angela
Автор

Again... if I use hr.holidays instead of account.invoice no problem arises..

Аватар
Bonnet Denis
Найкраща відповідь

Try to :

  1. uninstall your module
  2. restart your server OpenERP
  3. install your module

I had the same problem and it's the only one solution i found. Tell me if it work.

0
Аватар
Відмінити
Bonnet Denis

http://help.openerp.com/question/1095/how-to-make-openerp-take-my-python-code-modifications-into-account/ this my post on my problem with a good answer

Enjoying the discussion? Don't just read, join in!

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

Реєстрація
Related Posts Відповіді Переглядів Дія
What's the context? Вирішено
development v7
Аватар
Аватар
Аватар
Аватар
9
бер. 24
120420
How to hook to events of objects?
development v7
Аватар
Аватар
1
черв. 20
12782
Editing process in openerp Вирішено
development v7
Аватар
Аватар
Аватар
2
бер. 16
10953
Is there a change in how new modules are created in v7?
development v7
Аватар
1
бер. 15
4351
How to make OpenERP take my python code modifications into account?
development v7
Аватар
Аватар
2
бер. 15
10722
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція 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