Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Odoo 10 - Inherited template field appears depends upon position

Odebírat

Get notified when there's activity on this post

This question has been flagged
viewsfieldsinheritodoo10
2 Odpovědi
5393 Zobrazení
Avatar
Carlos

Hi.

This is a very strange behaviour. Let me explain.

I need to add a fied to invoice form. To do that

1) I've created custom module to inherit account.invoice and added the field

2) I've created a view and inherited account.form_view

3) I've inserted the new field in the new view.

Stange behaviour:

If I put the field in the main body (not into a notebook element) of th invoice, all works fine. If I insert the field after invoice's secodary field (in my case this secondary field is "name" inside "Other info" notebook), a "field does not exist" error arises.

My model:

class InvoiceInherit (models.Model):
    _inherit = 'account.invoice'
ref2 = fields.Char(string='Reference2',readonly=True, states={'draft': [('readonly', False)]}, copy=False, help='It will appear in invoice doc under "Client order''s date')

My view ("invoice_form_ref2"):

<?xml version="1.0" encoding="UTF-8"?>
<odoo>

    <record id="view_partner_form_id" model="ir.ui.view">
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <field name="ref" position="after">
                <field name="provider_id"
                       placeholder="Provider ID"/>
            </field>
        </field>
    </record>

    <record id="invoice_form_ref2" model="ir.ui.view">
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_form"/>
        <field name="arch" type="xml">
            <field name="name" position="after"> <-- with this, raise an "field ref2 does not exist" error on update module
                <field name="ref2"/>
            </field>
        </field>
    </record>
</odoo>

if I use

<field name="payment_term_id" position="after">

All things work fine.

Please, note that both fields "name" and "payment_term_id" exists into account.invoce but are rendered in different positions:

"payment_term_id" is redered in the "main" invoice body, but

"name" is rendered inside "other info" notebook.

Thank yu for your help

0
Avatar
Zrušit
Avatar
Carlos
Autor Nejlepší odpověď

¡SOLVED!

It has been my mistake.

In the account.invoice_form view there is another field "name", so the "field name="name" clause appears twice.

The error appears because Odoo does not know which of the two is referenced. I thought it was because of the position, but it was because of the name of the field.

I've used a xpath expression to replace the inside of the group ("other info") where I want to add the new field.


Anyway, thank you Niyas for your help.

0
Avatar
Zrušit
Avatar
Niyas Raphy (Walnut Software Solutions)
Nejlepší odpověď

Hi, 

The problem is with the inherit_id , when you refer the field in original view (invoice_form ) , you can use inherit_id as account.invoice_form , that  is why the first case worked fine for you.

Later the field you referring will be coming from an inherited view, check and find that view and use it as the inherit_id .


Thanks


       
-1
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Is there an option or method to auto select the value in a field when you click on it in edit mode?
views fields odoo10
Avatar
Avatar
1
bře 19
5135
How to add a field to existing tree view? Vyřešeno
views code fields inherit OdooV13
Avatar
Avatar
1
pro 22
7458
[CLOSED] I'm getting a validation error "Some fields are not set" set when using dynamic attributes. Vyřešeno
attrs views fields form_view odoo10
Avatar
Avatar
Avatar
8
pro 22
6501
How to use a new field added in a inherited model into a view?
views inherit
Avatar
Avatar
Avatar
3
srp 22
12794
odoo 10 : form for picking with only one field
views odoo10
Avatar
Avatar
Avatar
2
pro 19
3698
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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