Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Why this action menu voice appears only in the sale order view?

Odoberať

Get notified when there's activity on this post

This question has been flagged
actiontreeviewodoo11
1 Odpoveď
5199 Zobrazenia
Avatar
Daniele Morelli

I am using odoo11, and i am working on the following code, that adds a menu item in the "action" dropdown for sale orders, in order for the user to confirm multiple sale orders at once:


Python:

class SaleOrderConfirmWizard(models.TransientModel):
    _name = "sale.order.confirm.wizard"
    _description = "Wizard - Sale Order Confirm"

    @api.multi
    def confirm_sale_orders(self):
        self.ensure_one()
        active_ids = self._context.get('active_ids')
        orders = self.env['sale.order'].browse(active_ids)
        for order in orders:
            print(order.id)
            if order.state in ['draft', 'sent']:
                order.action_confirm()
 

XML:

    <record id="view_confirm_sale_order" model="ir.ui.view">
        <field name="model">sale.order.confirm.wizard</field>
        <field name="arch" type="xml">
            <form string="Confirm Sale Orders">
                <footer>
                    <button name="confirm_sale_orders" string="Confirm" type="object" class="oe_highlight"/>
                    or
                    <button string="Cancel" class="oe_link" special="cancel" />
                </footer>
            </form>
        </field>
    </record>

    <record id="action_confirm_sale_order" model="ir.actions.act_window">
        <field name="name">Confirm Sale Orders</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">sale.order.confirm.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_confirm_sale_order" />
        <field name="target">new</field>
        <field name="multi">True</field>
    </record>

    <act_window id="confirm_sale_order"
        name="Confirm Sale Orders"
        src_model="sale.order"
        res_model="sale.order.confirm.wizard"
        view_type="form"
        view_mode="form"
        key2="client_action_multi"
        target="new"/>

Now, I may be blind, but I can't see anywhere the reference to the treeview (which is "sale.view_order_tree" if im not wrong) this stuff should appear in.

I wanted something similar for the "quotation" treeview, and i thought i had to change some view reference (quotations are still instances of "sale.order" model, so i guess i have to change nothing on the model side)...

But, as strange as it sounds, i cannot find in this code any reference to the sale order treeview to change. I am probably missing something very evident, so please forgive this pretty dumb question.

Thank you in advance


EDIT:

I can't really explain why, but now i can see the new menu item even in the quotation page (maybe i didn't refresh properly the page?). In any case, i'd like to know if its normal that there is no explicit reference to the view?

0
Avatar
Zrušiť
Avatar
Pablo Guerra
Best Answer

Didn't get why you added 2 act windows.

For your purpose, ie to confirm together multiple sale records, the action button should only appear only in the tree view, and not in the form view.

So after you defined the view (id="view_confirm_sale_order")
you'll need to define just one act window

something like

<act_window id="action_confirm_multiple_orders"
            name="Confirm Multiple orders"
            key2="client_action_multi"
            view_mode="form"
            multi="True"
            target="new"
            src_model="sale.order"
            res_model="sale.order.confirm.wizard"
        />


Instead of 2 act windows.

Please accept and Upvote, if useful.

1
Avatar
Zrušiť
Daniele Morelli
Autor

Thank you for your kind answer... I must admit that i based my code on stuff i found online. Probably the original author was interested in making the menu voice appear in both kind of views...

Cheers

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Select multiple rows and perform one action - Odoo 11 Solved
treeview odoo11
Avatar
Avatar
Avatar
2
máj 21
20176
How to call ir.actions.client in a thread?
action odoo11
Avatar
0
aug 19
4692
Can i populate data from O2M lines on button type action in another form O2M lines??
action button odoo11
Avatar
Avatar
1
jún 20
3292
Automated action for all models
action automated odoo11
Avatar
0
feb 19
3588
Error while trying to display a model's tree view Solved
action treeview act_window
Avatar
Avatar
1
feb 19
8155
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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