Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

brings up the tree in the actions menu

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
treeviewmenucustomodoo15
1 Atsakyti
1576 Rodiniai
Portretas
Aprilia Zahratunnisa

<record id="view_sales_so_tree" model="ir.ui.view">        <field name="name">sales.so.tree</field>        <field name="model">sale.order</field>        <field name="arch" type="xml">            <tree string="Sales SO" create="false" >                <field name="name" string="Number"/>                <field name="date_order" widget="date"/>                <field name="product_type" string="Product Type"/>                <field name="customer_display_name" string="Customer"/>                <field name="user_id" widget="many2one_avatar_user"/>                <field name="amount_total" sum="Total"/>                <field name="state" decoration-success="state == 'sale' or state == 'done'" decoration-info="state == 'draft' or state == 'sent'" widget="badge"/>            </tree>        </field>    </record>


    <record id="action_sales_so" model="ir.actions.act_window">        <field name="name">Sales SO</field>        <field name="res_model">sale.order</field>        <field name="view_mode">tree,form</field>        <field name="view_id" ref="view_sales_so_tree"/>        <field name="view_ids" eval="[(5, 0, 0), (0, 0, {'view_mode': 'tree', 'view_id': ref('view_sales_so_tree')}),  (0, 0, {'view_mode': 'form', 'view_id': ref('view_sales_so_form')})]"/>        <field name="domain">[('is_sales_so', '=', True)]</field>        <field name="context">{'default_is_sales_so': True}</field>    </record>



I want to display view_sales_so_tree in the action menu action_sales_so. and the data entered does not appear in the tree. can anyone help me?

0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Almost your code is correct. Please make sure the field is_sales_so is properly defined in the Python model (sale.order) and also included in the form view (even if invisible). This ensures that the domain filter [('is_sales_so', '=', True)] works correctly, and records can be created with is_sales_so = True using the context.


Please refer to the code below:

Python


from odoo import models, fields


class SaleOrder(models.Model):

    _inherit = 'sale.order'


    is_sales_so = fields.Boolean(string="Is Sales SO", default=False)


XML:


<!--    Inherit sale order and add field is_sales_so-->

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

        <field name="name">sale.order.form.is.sales.so</field>

        <field name="model">sale.order</field>

        <field name="inherit_id" ref="sale.view_order_form"/>

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

            <xpath expr="//sheet/group" position="inside">

                <field name="is_sales_so" invisible="1"/>

            </xpath>

        </field>

    </record>

<!--    Tree view-->

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

        <field name="name">sales.so.tree</field>

        <field name="model">sale.order</field>

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

            <tree string="Sales SO" create="false">

                <field name="name" string="Number"/>

                <field name="date_order"/>

                <field name="partner_id" string="Customer"/>

                <field name="user_id" widget="many2one_avatar_user"/>

                <field name="amount_total" sum="Total"/>

                <field name="state" widget="badge"

                       decoration-success="state == 'sale' or state == 'done'"

                       decoration-info="state == 'draft' or state == 'sent'"/>

            </tree>

        </field>

    </record>

<!--    Action-->

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

        <field name="name">Sales SO</field>

        <field name="res_model">sale.order</field>

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

        <field name="view_id" ref="view_sales_so_tree"/>

        <field name="view_ids" eval="[(5, 0, 0),

            (0, 0, {'view_mode': 'tree', 'view_id': ref('view_sales_so_tree')}),

            (0, 0, {'view_mode': 'form', 'view_id': ref('sale.view_order_form')})]"/>

        <field name="domain">[('is_sales_so', '=', True)]</field>

        <field name="context">{'default_is_sales_so': True}</field>

    </record>


Hope it helps.

0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
How to add a menu under Accounting -> Reporting -> Leagal Reports ->Accounting Reports , Afetr Balance Sheet?
menu custom
Portretas
0
kov. 15
4059
How can the price_unit field not change even if the other columns are changed?
sale custom odoo15
Portretas
Portretas
Portretas
2
gruod. 24
2400
Can I modify the menu item "More" in tree view?
treeview menu modify
Portretas
0
kov. 17
3800
How to modify UserMenu?
menu custom base.xml
Portretas
Portretas
Portretas
4
kov. 17
11906
change the default odoo 15 form
form custom menuitem odoo15
Portretas
0
lapkr. 24
2072
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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