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

Creating new view from a old view

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
viewres.partnerinherit
11 Odpowiedzi
14403 Widoki
Awatar
Lawrence

I have to create a view from the view "view_partner_tree"(base.res_partner) without touching the original. In the view that I create, I have to add some function field (not stored). I managed to create a new module displaying the view "view_partner_tree" on a different page. Would really kind of any of you to maybe guide me a bit through it or to give me a link that might help. (I have read anything google could find me with (inheritance, view)

_description = 'Aged Partner Balance'   
def _get_not_due(self, cr, uid, ids, name, arg, context):
    res = {}
    return res

_name = 'aged.partner.balance'
_columns = {
    'not_due': fields.function(_get_not_due, type='char', string="Not Due")       
    }   


    <record id="view_partner_tree" model="ir.ui.view">
        <field name="name">res.partner.tree</field>
        <field name="model">res.partner</field>
        <field eval="8" name="priority"/>
        <field name="arch" type="xml">
            <tree string="Contacts">
                <field name="name"/>
                <field name="function" invisible="1"/>
                <field name="phone"/>
                <field name="email"/>
                <field name="user_id" invisible="1" />
                <field name="is_company" invisible="1"/>
                <field name="country" invisible="1"/>
                <field name="country_id" invisible="1"/>
                <field name="parent_id" invisible="1"/>
            </tree>
        </field>
    </record>
   <record id="view_res_partner_filter" model="ir.ui.view">
        <field name="name">res.partner.select</field>
        <field name="model">res.partner</field>
        <field name="arch" type="xml">
            <search string="Search Partner">
               <field name="name"
                   filter_domain="['|','|',('name','ilike',self),('parent_id','ilike',self),('ref','=',self)]"/>
               <filter help="My Partners" icon="terp-personal+" domain="[('user_id','=',uid)]"/>
               <separator/>
               <filter string="Persons" name="type_person" icon="terp-personal" domain="[('is_company','=',0)]"/>
               <filter string="Companies" name="type_company" icon="terp-partner" domain="[('is_company','=',1)]"/>
               <separator/>
               <filter string="Customers" name="customer" icon="terp-personal" domain="[('customer','=',1)]" help="Customer Partners"/>
               <separator/>
               <filter string="Suppliers" name="supplier" icon="terp-personal" domain="[('supplier','=',1)]" help="Supplier Partners"/>
               <field name="category_id" string="Tag" filter_domain="[('category_id','ilike', self)]"/>
               <field name="user_id"/>
               <field name="parent_id" filter_domain="[('parent_id','child_of',[self])]"/>
               <group expand="0" string="Group By...">
                   <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by' : 'user_id'}" />
                   <filter string="Company" context="{'group_by': 'parent_id'}"/>
               </group>
           </search>
        </field>
    </record>


    <record id="action_partner_form" model="ir.actions.act_window">
        <field name="name">Aged Partner Balance</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">res.partner</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree</field>
        <field name="context">{"search_default_customer":1}</field>
        <field name="search_view_id" ref="view_res_partner_filter"/>
    </record>

    <record id="action_partner_tree_view1" model="ir.actions.act_window.view">
        <field name="sequence" eval="1"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="view_partner_tree2"/>
        <field name="act_window_id" ref="action_partner_form"/>
    </record>


    <menuitem id="menu_partner_form" parent="base.menu_sales" action="action_partner_form" sequence="1"/>
</data>

</openerp>

1
Awatar
Odrzuć
Bonnet Denis

What do you want to say about "different pages" : in a new menu or a new tab in form view?

Lawrence
Autor

in a new menu

Sehrish

You just need to inherit original view

Awatar
Bonnet Denis
Najlepsza odpowiedź

This is an example I make to a perso module:

<record id="view_task_form2_inherit" model="ir.ui.view">
    <field name="name">project.task.form.inherit</field>
    <field name="model">project.task</field>
    <field name="inherit_id" ref="project.view_task_form2"/>
    <field name="arch" type="xml">
        <field name="work_ids" groups="project.group_tasks_work_on_tasks" position="replace">
            <field name="work_ids" groups="project.group_tasks_work_on_tasks">
                <tree string="Task Work" editable="top">
                    <field name="id" invisible='1'/>
                    <field name="name" on_change="onchange_name(name,id)"/>
                    <field name="date" on_change="onchange_date(date,id)"/>
                    <field name="hours" widget="float_time" sum="Spent Hours" on_change="onchange_hours(hours,id)"/>
                    <field name="user_id" on_change="onchange_user_id(user_id,id)"/>
                </tree>
            </field>
        </field>
    </field>
</record>

Here the documentation about inheritance in Views in V6.1(Work with v7.0 too)

When you create a new menu, you associate this to a act_window and this act_window have to be associate to your custom view. If you need some more explication I can give it.

1
Awatar
Odrzuć
Lawrence
Autor

I have done something similar aswell. But now I want to create a new module that would looks like the page "Customers" but with like 7 more functions fields. (I read that doc a while ago, but thanks).

Bonnet Denis

Inherit from "Customers" view, add some function fields and call your new view In your module.

Lawrence
Autor

I thought that doing so would just add the new fields in the old "customers" view and wouldnt create a different view. I think I have a idea tho. Im going to try this right away. Anything i should put in the .py?

Lawrence
Autor

When I do that I get a error which says that it can't find the function field that i added in the model : "res.partner", but when i put mine "aged.partner.balance" it says that it cant render the view with this model

Lawrence
Autor

Can't find field 'not_due' in the following view parts composing the view of object model 'res.partner': Can't render view aged_partner_balance.view_partner_tree for model: aged.partner.balance

Bonnet Denis

Do you have restart the server and update your module? see http://help.openerp.com/question/1118/how-can-i-reload-source-code-without-restarting-the-openerp-server/

Lawrence
Autor

yes :S do you want me to show you my .py and xml?

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ść
inherit res.partner view
view res.partner inherit
Awatar
Awatar
1
mar 15
12010
How to inherit from view to add an element in it ?
view inherit
Awatar
Awatar
1
mar 15
9418
How to create another type of Invoice with other sequence?
view inherit
Awatar
0
mar 15
4851
Inherit a predefined view.
view inherit
Awatar
Awatar
1
mar 15
6453
How to add a field conditional to tree view of customer? Rozwiązane
treeview view res.partner hide inherit
Awatar
Awatar
Awatar
Awatar
Awatar
4
gru 23
40103
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