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

v16: while Upgrading Module it is showing View related Error

Subscriure's

Get notified when there's activity on this post

This question has been flagged
viewsodoo16features
1 Respondre
2914 Vistes
Avatar
SmithJohn45

hi all, i am creating a custom module, i have created Model and it can be seen in Technical -> Models (the code is below) which is fine, then i created View but when upgrading Module in Apps it is throwing Error. 

due to some problems here i am posting View code and Error message in Comment.

please help to find out what i am doing wrong and how to resolve it.


My Model code is here:

from odoo import models, fields


class CRMInquiry(models.Model):

_name = 'crm.inquiry'

_description = 'CRM Lead Inquiry'


product_id = fields.Many2one('product.product', string='Product Name', required=True)

qty = fields.Integer(string='Quantity', default=1)


note: as mentioned above, check View code and Error in Comments below.

in continuation of my topic below :

https://www.odoo.com/forum/help-1/v16-inherit-crm-pipeline-view-and-add-page-tab-with-custom-fields-236904

regards

0
Avatar
Descartar
SmithJohn45
Autor

My view code as per your advised code:

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_crm_lead_form_inherit01" model="ir.ui.view">
<field name="name">crm.leads.inherit</field>
<field name="model">crm.inquiry</field>
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='lead']" position="after">
<page name="">th
<group>
<field name="product_id"/>
<field name="qty"/>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

SmithJohn45
Autor

the Error while upgrading Module through Apps:

<form class="o_lead_opportunity_form" js_class="crm_form">
<header>
<button name="action_set_won_rainbowman" string="Won" type="object" class="oe_highlight" data-hotkey="w" title="Mark as won" attrs="{'invisible': ['|','|', ('active','=',False), ('probability', '=', 100), ('type', '=', 'lead')]}"/>

Field `stage_id` does not exist

View error context:
{'file': 'd:\\program files\\odoo '
'16.0e.20230607\\server\\odoo\\custom_addons\\crm_customz\\views\\crm_leads_custom_inquiry.xml',
'line': 1,
'name': 'crm.leads.inherit',
'view': ir.ui.view(2407,),
'view.model': 'crm.inquiry',
'view.parent': ir.ui.view(2318,),
'xmlid': 'view_crm_lead_form_inherit01'}

Avatar
Nikhil Nakrani
Best Answer

Hi SmithJohn,

Based On your Code:

  1. When you create view for this specific model (crm.inquiry) then its not present in odoo default code so you need create its own view.
  2. Don't inherit (crm_lead_view_form) this  view because this is used in (crm.lead) model if you add your both field inside (crm.lead) then you need to inherit this view.
  3. Right now you create your new model (crm.inquiry) so you need to create  its own view.
  4.  For your information if you need to add your both field like product_id and qty add in crm.lead  model then you need to add like this way (_inherit="crm.lead") and crm module add in depends of manifest file.

Thanks.

1
Avatar
Descartar
SmithJohn45
Autor

thank you @Nikhil , i really don't know about this limitation,

the above mentioned View code is a sample to check if its correct or not. actually this will crm.inquiry will have multiple rows, view will be created with ' tree view + editable=bottom '.

as per your advise, if i add both fields in crm.lead and inherit view, add the functionality for multiple rows, how it will work? what i have to do to achieve this?

hope this clear.

regards

SmithJohn45
Autor

thanks a lot @Nikhil Nakrani,

now it is clear why it is showing error as mentioned in my opening post 2nd comment.
for beginners like me who can face the same situation:
- when we Inherit a view, we have to use same Model in original view which we are inheriting, because the view we are creating is actually Based on original view. hope this will help.

regards

Nikhil Nakrani

Welcome SmithJohn

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
want to find a tiny View to edit with Odoo frontend via Settings...
views odoo16features
Avatar
Avatar
Avatar
2
d’ag. 24
5120
User Access in Specific Field
views odoo16features
Avatar
Avatar
Avatar
2
de gen. 24
2695
how to use FIGMA for Odoo to create Forms, Tree and other Views
views odoo16features beautify
Avatar
Avatar
1
de des. 24
6220
How to modify dynamically tree attribute inside form view in odoo16?
views xml odoo16features
Avatar
0
de gen. 24
3525
How to add a group to inherited view odoo16 Solved
views groups odoo16features
Avatar
Avatar
Avatar
3
de nov. 23
15860
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