تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    الحصول على عرض توضيحي
  • الأسعار
  • المساعدة

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

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

wizard to perform selection in tree view

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
wizardtreeviewselection
2 الردود
26681 أدوات العرض
الصورة الرمزية
Alkivi SAS

Hi there,

I'm trying to create a wizard, that display a list (tree view). User will then pick the wanted element and the wizard will return it to perform some action.

I'm able to create the wizard, perform the search to obtain the list, but I'm unable to catch the selection for a specific element in the tree view.

Any idea how to do that ?

Thanks !

5
الصورة الرمزية
إهمال
abdelwahed chiheb

Hi Alkivi, could you please show us your code to help u ! Thanks

الصورة الرمزية
Amílcar Sánchez
أفضل إجابة

Did you fix this? I'm having the same problem

0
الصورة الرمزية
إهمال
الصورة الرمزية
Alkivi SAS
الكاتب أفضل إجابة

Hi there,

sorry about the delay ... Just started to work again on this. Overall, the technic seems OK, but here is my current issue.

On the wizard, I have a tree with several objects. User need to pick the correct one (a button seems appropriate) and then some action is performed, linking the source object (the one the wizard comes from) and the destination object (the user choice).

I'm thinking about creating an inherited object for the destination object with an extra method matching my exact needs. Any advice ? The more I go forward, the more I created complexity. I'd like a simple and elegant solution to that ;)

Cheers

Here is some code

The transaction view form (goal: launch wizard)

    <record model="ir.ui.view" id="view_linxo_transaction_form">
        <field name="name">linxo.transaction.form</field>
        <field name="model">linxo.transaction</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Transaction Info">
                <group colspan="4" col="2">
                    <field name="date" readonly="1"/>
                    <field name="label" readonly="1"/>
                    <field name="notes" readonly="1"/>
                    <field name="amount" readonly="1"/>
                    <field name="account_move_line_id"  attrs="{'invisible':[('account_move_line_id','=',False)]}" />
                    <field name="journal_id" readonly="1"/>
                </group>
                <button name="open_wizard"
                    string="Reconcile Wizard"
                    type="object"
                    help="Find associated movement" attrs="{'invisible':[('account_move_line_id','!=',False)]}"
                    class="oe_highlight" />
            </form>
        </field>
    </record>

Now the open_wizard method :

def open_wizard(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
    if not ids:
        return False
    if not isinstance(ids, list):
        ids = [ids]

    transaction = self.browse(cr, uid, ids, context=context)[0]

    vals = { 'transaction_id': ids[0], 'date': transaction.date }
    if transaction.amount > 0:
        vals['debit'] = transaction.amount
    else:
        vals['credit'] = -transaction.amount

    wizard_id = self.pool.get('linxo.reconcile').create(cr, uid, vals=vals, context=context)
    return {
        'name': 'Reconcile Wizard',
        'view_type': 'form',
        'view_mode': 'form',
        'res_model': 'linxo.reconcile',
        'res_id': wizard_id,
        'type': 'ir.actions.act_window',
        'target': 'new',
        'context': context,
    }

The wizard class :

class linxo_reconcile(osv.osv_memory):
    _name='linxo.reconcile'

    def _get_candidates(self, cr, uid, ids, field_name, arg, context):
        """Will return a list of ids according to the match
        """
        result = {}

        wizard = self.browse(cr, uid, ids, context=context)[0]
        wizard_id = ids[0]

        transaction = wizard.transaction_id
        if not transaction:
            return result

        _logger.debug('Got transaction %d' % transaction.id)

        search_args = [
            #('date', '=', wizard.date),
            ('journal_id', '=', transaction.journal_id.id),
        ]

        if wizard.credit:
            search_args.append(('credit', '=', wizard.credit))
        else:
            search_args.append(('debit', '=', wizard.debit))

        _logger.debug('Search criteria for account.move.line')
        _logger.debug(search_args)

        account_ids = self.pool.get('account.move.line').search(cr, uid, search_args, context=context)
        _logger.debug('Search result for account.move.line')
        _logger.debug(account_ids)

        if account_ids:
            result[wizard_id] = account_ids
        else:
            #res[i] must be set to False and not to None because of XML:RPC
            # "cannot marshal None unless allow_none is enabled"
            result[wizard_id] = False

        return result

    _columns = {
        'date': fields.date('Date'),
        'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
        'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
        'transaction_id': fields.many2one('linxo.transaction', 'Original Transaction'),
        'candidates' : fields.function(_get_candidates, type='one2many', obj='account.move.line', method=True, string='Matching Transactions'),
    }

And finally, the wizard view :

    <record model="ir.ui.view" id="view_linxo_reconcile">
        <field name="name">linxo.reconcile.view</field>
        <field name="model">linxo.reconcile</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Reconciliation Wizard" version="7.0">
                <group string="Search criteria" col="4">
                    <field name="date" readonly="1" />
                    <field name="debit" readonly="1" />
                    <field name="credit" readonly="1" />
                </group>
                <separator string="Candidates" colspan="4"/>
                <field name='candidates'>
                    <tree string="Matching candidates">
                        <field name="date" readonly="1" />
                        <field name="debit" readonly="1" />
                        <field name="credit" readonly="1" />
                        <field name="state" readonly="1" />
                        <field name="partner_id" readonly="1" />
                    </tree>
                </field>
               <footer>
                   <button string="Cancel" special="cancel"/>
               </footer>
            </form>
        </field>
    </record>
0
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
sending selected records to a wizard
wizard selection
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
مايو 24
2427
open wizard from tree view
wizard treeview
الصورة الرمزية
الصورة الرمزية
1
يناير 16
7916
How to make button in tree view header always show up without selecting a record? تم الحل
wizard treeview button
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
5
سبتمبر 25
16180
Call an intermediate wizard on Create or Delete button in a tree view
wizard treeview v15
الصورة الرمزية
0
يناير 23
2708
Create a tree selection wizard
wizard selection tree
الصورة الرمزية
0
أغسطس 22
3039
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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