Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Using a Module to Customize Product Tree View

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
viewsmodulesxmlinheritance
5 Odpowiedzi
14101 Widoki
Awatar
Jayson Wu

Hi,

I'm trying to add another column on the Product Tree View by using a module.

However, I'm receiving this error message: except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

This is what I got so far,

__openerp__.py => I already added 'product' on the 'depends' field.

mymodule.py =>

class custom_products(osv.osv):
    _name = "product.product"
    _inherit = "product.product"
    _columns = {
        'asupplier_code': fields.char('Supplier Code',size=32),
    }
    _defaults = {
        'asupplier_code': '-',
    }
custom_products();

mymodule_view.xml =>

<record model="ir.ui.view" id="attempt_2_form">
    <field name="name">product.product.tree</field>
    <field name="model">product.product</field>
    <field name="type">tree</field>
    <field name="inherit_id" ref="product.product_product_tree_view"/>
    <field name="arch" type="xml">
        <field name="default_code" position="after">
            <field name="assupplier_code"/>
        </field>
    </field>
</record>

From what I understand, (when trying to create a module that will edit an existing view)

<field name="name">product.product.tree</field> : I got the value from the View Name field

<field name="model">product.product</field> : I got it from the Object field

<field name="inherit_id" ref="product.product_product_tree_view"/> : The ref would be the name of the view that I wish to inherit right?

Is there something wrong with my understanding and code that results with a Invalid XML for View Architecture?

Thanks!

0
Awatar
Odrzuć
Jayson Wu
Autor

I finally found what's wrong. The field name has an extra 's'.

Jayson Wu
Autor

still not fixed though.

Awatar
Alfa y Omega Pachuca
Najlepsza odpowiedź

In odoo 9 (in you have you odoo server in other directory, just change the path to you odoo directory installation)

Create a new custom module:

cd /odoo/odoo-server <--Here inside is the odoo.py script to create a new custom module.

sudo ./odoo.py scaffold myproductviewtreelist /odoo/custom/addons <--This is my directory for my custom modules, this code create a new custom module

cd /odoo/custom/addons/myproductviewtreelist

Edit  __openerp__.py and save this settings:

locate: 'depends': ['base'], and add 'sale' like this:

'depends': ['base','sale'],

Edit emplates.xml and save this settings:

add this code: <--In my case a just want add the default_code field but you can add any field from your product form.

<record id="my_view_products_tree_inherit" model="ir.ui.view">

<field name="name">my.view.products.tree.inherit</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_tree_view"/>

<field name="arch" type="xml">

<!-- Before the field 'name' i add the 'default_code' field, or any field from my product form-->

<field name="name" position="before">

<field name="default_code"/>

</field>

</field>

</record>

Go to top menu/apps on line then go to left menu update apps list, delete the filter in the search box app and put my and search, then install the module myproductviewtreelist

0
Awatar
Odrzuć
Awatar
René Schuster
Najlepsza odpowiedź

In your __openerp__.py file you should add your custom view:

'data': [
'yourmodule_view.xml'
]

Regards.

0
Awatar
Odrzuć
Awatar
Bole
Najlepsza odpowiedź

In your module you have declared new class custom_products...

and in view you are calling odl class product.product...

rename your module class to :

class product_product (osv.osv):
..... 

 

0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
OpenERP v7.0 inherit view to add field
modules xml inheritance
Awatar
Awatar
Awatar
3
mar 15
6998
Inherited form view for specific module without overriding base view - Odoo 15.0
views modules xml form
Awatar
Awatar
1
mar 22
4057
Replace xpath expr with xpath
views xml inheritance xpath
Awatar
0
sie 21
4156
models in records?
views modules xml odoo
Awatar
Awatar
1
maj 16
4644
How do I access sub-components of a list field? Rozwiązane
views xml inheritance extend
Awatar
Awatar
Awatar
2
mar 15
7691
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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