Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Inherited views

Subscriure's

Get notified when there's activity on this post

This question has been flagged
viewinheritancefieldmodeldesign
1 Respondre
6360 Vistes
Avatar
Andrea Dalseno

Hi I'm trying to make an inherited view of res.partner.

My model (to begin) is as simple as this:

class genial_2015(osv.osv):

"""Db test genial_2015 """

_name = 'genial.2015'

_inherit = 'res.partner'

_columns = {

'titolo': fields.char ('Titolo', size = 31)

}

So it inherits from res.partner. And it works fine (I will have more fields later).

I'm trying to inherit the "base.view_partner_form" view (so that I will have all the fields properly formatted and the view design in place) and add my custom field to it.

This is my view

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

<field name="name">genial.2015.form</field>

<field name="model">genial.2015</field>

<field name="priority" eval="1"/>

<field name="type">form</field>

<field name="inherit_id" ref="base.view_partner_form"/>

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

<form string="Partners">

<xpath expr="//field[@name='website']" position="after">

<field name="titolo" />

</xpath>

</form>

</field>

</record>

The module installs and I can see the form, but it's not the well formatted and designed res.partner.from, it's a mess with all the fields confused. Why? What am I doing wrong? Or what am I missing? This is a link to my window (hope it works).

http://postimg.org/image/s6ugg0iod/

My action definition is:

<record model="ir.actions.act_window" id="action_genial_2015">

<field name="name">genial.2015</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">genial.2015</field>

<field name="view_type">form</field>

<field name="view_mode">form</field>

</record>

I tried to give the view the same name as res.partner with the same model. In such a case I can see the view properly formatted, but there is no way to show my custom field. If I try with <field genial_2015_name="titolo" /> I got an error!

I tried to give the view a lower priority, but nothing changed. Of course modifying res.partner model will solve the problem, but I'd like to understand why I can't make it work with an inherited model.

I'm running  Odoo Version 8.0-a2115ef on Ubuntu 14.04 (Bitnami stack)

Thanks.

0
Avatar
Descartar
Avatar
Andrea Dalseno
Autor Best Answer

I tired to remove the _name declaration form my model as suggested here:

https://www.odoo.com/forum/help-1/question/view-inherit-from-res-partner-appears-all-one-page-with-no-styling-or-formatting-30444

But it didn't work either.

Ok, after reading a post here, I managed to have my view properly formatted. View does not inherit the design so you have to recreate yourself (I wonder what inheritance means?) and here is the result with my field under the website field.

http://postimg.org/image/95lfipgh5/

The problem is that I installed a couple of modules that modified the res.partner view (a tab for geolocalization data and a button for a map). This is the res.partner view:

http://postimg.org/image/7hhtugqqx/

What do I have to do to have them in my view too? Copy and paste the code again? What inheritance means then? At this point I had better modify res.partner instead of create my own model, hadn't I?

Any suggestion?

Thanks.

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
How to make a field readonly in a form view according to another model field value? Solved
form view field readonly model
Avatar
Avatar
Avatar
6
d’abr. 22
44173
Inherited fields, modified model and views
v8 fields view inheritance model
Avatar
Avatar
4
d’oct. 15
10456
Add field from another module to project.issue kanban view Solved
project view inheritance kanban model
Avatar
Avatar
Avatar
3
de set. 15
7113
Add field from another module to project.issue kanban view
project view inheritance kanban model
Avatar
0
de set. 15
47
Custom float field with % sign Solved
view field model float custom_view
Avatar
Avatar
1
de jul. 15
4413
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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