Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Why is my many2one field not displayed the same way at this two places?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
addressformviewmany2one
5 Antwoorden
6545 Weergaven
Avatar
Pascal Tremblay

Hello all,

We are on Odoo 10.

I have declared a new many2one field customer_of_division_id in the model sale.order and in the model account.invoice.

I have added the field on the form view of both models this way :

<field name="customer_of_division_id"/>


My field is displayed like this in a new sale order :



And my field is displayed like this on a new invoice :



Why is it not the same on both? How to avoid all the address displayed on the second one?


EDIT #1 : Here is all the code

In the Python

class SaleOrder(models.Model):
_inherit = "sale.order"
    customer_of_division_id = fields.Many2one(related="partner_id.customer_of_division_id", string='Customer of the division')

class AccountInvoice(models.Model):
_inherit = "account.invoice"
    customer_of_division_id = fields.Many2one(related="partner_id.customer_of_division_id", string='Customer of the division', readonly=True)

In the XML

<record id="invoice_form" model="ir.ui.view">
    <field name="name">account.invoice.form.inherit.vtm2</field>
    <field name="model">account.invoice</field>
    <field name="inherit_id" ref="account.invoice_form" />
    <field name="arch" type="xml">
        <xpath expr="//field[@name='partner_shipping_id']" position="attributes">
            <attribute name="domain">['&amp;',('parent_id','=',partner_id),('type','=','delivery')]</attribute>
        </xpath>
        <field name="payment_term_id" position="after">
            <field name="customer_of_division_id"/>
        </field>
     </field>
</record>
<record id="view_order_form" model="ir.ui.view">
    <field name="name">sale.view.order.form.inherit.vtm2</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_form" />
    <field name="arch" type="xml">
        <xpath expr="//field[@name='partner_shipping_id']" position="attributes">
            <attribute name="domain">['&amp;',('parent_id','=',partner_id),('type','=','delivery')]</attribute>
        </xpath>
         <field name="payment_term_id" position="after">
             <field name="customer_of_division_id" attrs="{'readonly': [('state', 'not in', ('draft','sent'))]}"/>
         </field>
    </field>
</record>

0
Avatar
Annuleer
Akhil P Sivan

Hi, can you paste the code of your field definition and also xml inheritance code? How you pass value to the Many2one field on invoice?

Pascal Tremblay
Auteur

If I remove the 'Readonly=True' in my Python declaration, It is well displayed. Thanks. But it doesn't help me to understand why all the address was displayed..???!!! Big thanks

Akhil P Sivan

Sorry. I thought that it was an easy problem. I have put my code above. Thanks.

Avatar
Akhil P Sivan
Beste antwoord

For me it shows just partner without address after saving the invoice record. Can u just try without readonly=True.

I am not sure about that behaviour in readonly mode.

1
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Form view aligned to the left side Opgelost
form view
Avatar
Avatar
1
nov. 25
2479
How to create many2one field ??
form many2one
Avatar
Avatar
Avatar
Avatar
4
jul. 23
2891
OpenERP 7: hide Form Header for read only purpose Opgelost
form view
Avatar
Avatar
1
sep. 21
10192
"many2many_tags" show a refrence of the tag not the name !! Opgelost
form view
Avatar
Avatar
1
jan. 24
17791
How to write this domain for a one2many field on a view? Opgelost
domain form view many2one one2many
Avatar
Avatar
3
feb. 17
27246
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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