İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How can I pass a context from an action displaying a tree, to another action (a server action linked by MULTI)?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
actioncontextmulti
10552 Görünümler
Avatar
Luis Masuelli

Want to implement a server action (in the end, such action pops up an account.voucher dialog) for invoices. Only true invoices to clients / supplier are considered, while refunds are not considered. In the odoo core, such 4 actions (client invoice, client refund, supplier invoice, supplier refund) are defined like this:

    <record id="action_invoice_tree1" model="ir.actions.act_window">
        <field name="name">Customer Invoices</field>
        <field name="res_model">account.invoice</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form,calendar,graph</field>
        <field eval="False" name="view_id"/>
        <field name="domain">[('type','=','out_invoice')]</field>
        <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
        <field name="search_view_id" ref="view_account_invoice_filter"/>
        <field name="help" type="html">
            bla bla bla
        </field>
    </record>

This is just an example. By replacing out_invoice with the other 4 types, you have all the 4 actions.

Now the funny part: I want to implement a server action (my server action triggers an account.invoice function) that processes a bulk of selected invoices in the TREE, but taking the value in the "type" key in the context.

    <record id="action_massive_pay" model="ir.actions.server">
        <field name="state">code</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="model_account_invoice"/>
        <field name="code">action = self.massive_invoice_pay_wizard(cr, uid, context.get('active_ids', []), context)</field>
        <field name="condition">True</field>
        <field name="name">Register Massive Payment</field> 
    </record>

    <record id="action_massive_pay_more_link" model="ir.values">
        <field name="model_id" ref="model_account_invoice" />
        <field name="name">Register Massive Payment</field>
        <field name="key2">client_action_multi</field>
        <field name="value" eval="'ir.actions.server,' + str(ref('action_massive_pay'))"/>
        <field name="key">action</field>
        <field name="model">account.invoice</field> 
    </record>

In the implementation of massive_invoice_pay_wizard, I expect to be able to access the "type" key in the context, as it was provided by the originating actions (actions that displayed the tree), but the "type" key is not present while I ask for it in the context (type, default_type, and stuff like that as specified in the original actions are not present when I debug the context in my method).

So I tried to add the tag `<field name="context">{'type': type}</field>` both in the ir.values and the new server action records, but nothing happened: ir.values does not expect a context, and somehow the server action does not receive the context from the original action.

Finally, my goal is to have processing for two different invoice types, disallow credit/debit notes, and present an account.voucher dialog (one for all the selected invoices). How can I pass such context?

0
Avatar
Vazgeç
Maduka Sopulu

ADD THIS TO THE code tage

<field name="code">

if records:

action = records.action_export_and_download()

</field>

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
How to use the previous context in the action definition? Çözüldü
action context
Avatar
Avatar
1
Nis 25
4417
HOW CAN I GET CURRENT COMPANY ID IN CONTEXT OF ACTION USING JUST XML
action xml context odoo
Avatar
Avatar
1
Tem 24
2633
Context lost in button action
action buttons context v11.0
Avatar
Avatar
1
Haz 24
4414
Send and return values in action window button Çözüldü
action v6.0 context window
Avatar
Avatar
1
Kas 22
50120
How to pass context to a called action with kanban view links or buttons? Çözüldü
action view kanban context
Avatar
Avatar
1
Eki 21
19294
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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