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

How add new filed to res.partner ?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
res.partner
3 Odpowiedzi
17711 Widoki
Awatar
NiteshMVP

I'm new to OpenErp. I want to Add a new field "mother_name" in res.partner.So i have added the following code to res.partner.py In column's i have add like this

_columns = {
    'name': fields.char('Name', size=128, required=True, select=True),
    'date': fields.date('Date', select=1),
    'title': fields.many2one('res.partner.title', 'Title'),
    'parent_id': fields.many2one('res.partner', 'Related Company'),
    'child_ids': fields.one2many('res.partner', 'parent_id', 'Contacts', domain=[('active','=',True)]), # force "active_test" domain to bypass _search() override    
    'ref': fields.char('Reference', size=64, select=1),
    'date_delivery': fields.date('Expected Delivery Date'),
    'mother_ln': fields.char('Mother', size=64),
     .
     .
     .
     }

Now in res_partner_view.xml . I'm using the following code

    <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="date_delivery"/>
                <field name="mother_ln"/>
                <field name="parent_id" invisible="1"/>
            </tree>
        </field>
    </record>

<record id="view_partner_form" model="ir.ui.view"> <field name="name">res.partner.form</field> <field name="model">res.partner</field> <field eval="1" name="priority"/> <field name="arch" type="xml"> <form string="Partners" version="7.0"> <sheet> <field name="image" widget="image" class="oe_left oe_avatar" options="{"preview_image": "image_medium", "size": [90, 90]}"/>

<label for="name"/> ( <field name="is_company" on_change="onchange_type(is_company)" class="oe_inline"/> <label for="is_company" string="Is a Company?"/>)

<field name="name" default_focus="1" placeholder="Name"/>

<field name="parent_id" placeholder="Company" domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier}" attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}" on_change="onchange_address(use_parent_address, parent_id)"/>

                <group>
                    <group>
                        <label for="type" attrs="{'invisible': [('parent_id','=', False)]}"/>
                        <div attrs="{'invisible': [('parent_id','=', False)]}" name="div_type">
                            <field class="oe_inline"
                                name="type"/>
                        </div>

                        <label for="street" string="Address"/>
                        <div>
                            <field name="use_parent_address" class="oe_edit_only oe_inline"
                                   on_change="onchange_address(use_parent_address, parent_id)"
                                   attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
                            <label for="use_parent_address" class="oe_edit_only" attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
                            <button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
                                    attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
                            <field name="street" placeholder="Street..."  attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                            <field name="street2"  attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                            <div class="address_format">
                                <field name="city" placeholder="City" style="width: 40%%" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                                <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                                <field name="zip" placeholder="ZIP" style="width: 20%%" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                            </div>
                            <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}' attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                        </div>

                    </group>
                    <group>
                      <!-- We Don't require Job Position for Customer -->
                      <!--   <field name="function" placeholder="e.g. Sales Director"
                            attrs="{'invisible': [('is_company','=', True)]}"/> -->
                        <field name="phone" placeholder="e.g. +32.81.81.37.00"/>
                        <field name="mobile"/>
                        <field name="fax"/>
                        <field name="email" widget="email"/>
                        <!-- <field name="title" domain="[('domain', '=', 'contact')]"
                            options='{"no_open": True}' attrs="{'invisible': [('is_company','=', True)]}" /> -->
                    </group>
                    <field name="date_delivery"/>
                    <field name="mother_ln"/>
                    </group>
                    .
                    .
                    .
             </record>
0
Awatar
Odrzuć
Awatar
Shashank Verma
Najlepsza odpowiedź

Hello

Add new field in py file

columns={

mother_name': fields.char('Mother Name', size=64),

}

Xml file <tree> <field name="mother_name"/> </tree>

<form> <field name="mother_name"/> </form>
0
Awatar
Odrzuć
NiteshMVP
Autor

i've give the same dude.But i'm getting the following error "ProgrammingError: column res_partner.mother_name does not exist"

NiteshMVP
Autor

i'm getting the following error
OpenERP Server Error

Client Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 867, in authenticate req.session.authenticate(db, login, password, env) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", ProgrammingError: column res_partner.mother_name does not exist LINE 1: ...,res_partne

Shashank Verma

Have u updated the database by running -u all -d ur_db_name?

Awatar
Ankit H Gandhi(AHG)
Najlepsza odpowiedź

Hello Nitesh,

try this code may be help full

in .py file

from openerp.osv import osv, fields

class res_partner(osv.Model):
    _inherit = 'res.partner'
    _columns = {
        'mother_name': fields.char('Mother Name', size=64)
    }

in .xml file

<openerp>
    <data>
        <record model="ir.ui.view" id="view_partner_form_inherited">
            <field name="name">view.partner.form.inherited</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='website']" position="after">
                    <field name="mother_name"/>
                </xpath>
            </field>
        </record>
    </data>
</openerp>

if you find this answer helpful, please give me a thumbs up vote    

Thanks & Regards,

Ankit H Gandhi

0
Awatar
Odrzuć
Awatar
José DESGRIS
Najlepsza odpowiedź

Hello,

I have not tried python yet but I can tell you you can add a field using Odoo's technical interface.

Go to the database and add the field (Is it the error "the column does not exist" ???)

Then go to the views res.partner.tree and res.partner.form and add the field so it appears on the screen.

Best regards,

José

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ść
Domain for res.partner having which are tagged with users ? Rozwiązane
res.partner
Awatar
Awatar
2
paź 23
6605
Restrict duplicate phone number creation in res_partner odoo 16
res.partner
Awatar
Awatar
Awatar
Awatar
3
wrz 23
3411
Insert/update via API trying to create contact with contact image included, not inserting or updating field image_1920 on res.partner
res.partner
Awatar
0
maj 23
3386
Bonjour à tous comment faire de telle sort qu'un utilisateur ne voit que ses propres "contact" créé.
res.partner
Awatar
Awatar
1
maj 23
2599
Hello everyone how to make such a fate that a user sees only his own "contact" created Rozwiązane
res.partner
Awatar
Awatar
1
kwi 23
2375
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