تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (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
حول هذا المنتدى
المساعدة

show filtered records in one2many field using Domain

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
domainone2manyv7x2many
3 الردود
27124 أدوات العرض
الصورة الرمزية
Shaumyadeep Chaudhuri

Hi, Can i show only selected records in a one2many field using a domain, I have tried this

<field name="func_details_inno" nolabel="1" context="{'functional_dep' : 'Innovation'}" domain="[('functional_dep','=','Innovation')]">

where func_details_inno is a one2many field with functional_dep a char field in the model for func_details_inno

How can i do it?

0
الصورة الرمزية
إهمال
Xsias

You haven't closed the balise "/>". This is wanted ?

Shaumyadeep Chaudhuri
الكاتب

Yes this is wanted and intentional, i'm defining the tree view and the form view inside for the one2many field, something like <field name="func_details_inno" nolabel="1" context="{'functional_dep' : 'Innovation'}" domain="[('functional_dep','=','Innovation')]"><tree>...</tree><form>...</form></field>

Xsias

This is what i was thinking, but now i'm sure. Can you, for clarify, put all the field in the question please ?

Shaumyadeep Chaudhuri
الكاتب

Its a bit long i have pastebinned the most relevant part of it and here is the link http://pastebin.com/PJqY6uwk Hope that helps to solve the problem

الصورة الرمزية
Xsias
أفضل إجابة

Add :

<field name="functional_dep" invisible="True"/>

In the tree view of the "func_details_inno" field like that :

<tree>
    <!-- <field name="activity">
    <tree>
    <field name="activities"/>
    <field name="person"/>
    <field name="start"/>
    <field name="end"/>
    </tree>
    </field> -->
    <field name="functional_dep" invisible="True"/>
    <field name="activity"/>
    <field name="yes"/>
    <field name="no"/>
    <field name="na"/>
    <field name="reason" />
    <field name="risks" />
</tree>
1
الصورة الرمزية
إهمال
Shaumyadeep Chaudhuri
الكاتب

Thanks for your reply but the problem is not that i want to hide a particular column, it can simply be achieved by not including the field in the tree view at all. The problem is i want to filter rows in the tree view and hence the requirement for using domains

Xsias

Yes, but in my memories, if you want to filter on a field, you need to have this field in the tree view.

Shaumyadeep Chaudhuri
الكاتب

the functional_dep field is already there and it doesn't need to be invisible, i want to show only those rows which belong to a particular functional field, innovation in this case, there might be other records in the table which have some other functional_dep value

Xsias

functional_dep field is not in the tree. (not in the code you post on pastebin)

Shaumyadeep Chaudhuri
الكاتب

oh sorry, i had added it later after posting it. but it doesn't help

Xsias

Ok, can you post again your code on pastebin ? (To have the latest version)

Shaumyadeep Chaudhuri
الكاتب

yes sure, but theere aren't many big changes, here's the code http://pastebin.com/uVEReG7P

الصورة الرمزية
Timo Talvitie, Vizucom Oy
أفضل إجابة

This post at Launchpad discusses the issue, but it doesn't make it clear whether it is really a bug or simply by design. I had the same issue and tried two possible solutions:

1) Change the field to many2many if you have control over the field types. Domain filtering works fine with m2m fields, or

2) Follow this post by Andreas Brueckl that shows a way to do o2m filtering with a functional field and its fnct_inv parameter

They both worked, but converting relationships that clearly should be o2m to m2m just to get access to filtering functionality feels a bit wrong, so I ended up using solution #2.

0
الصورة الرمزية
إهمال
الصورة الرمزية
Purnendu Singh (psi)
أفضل إجابة

class one2many_mod2(fields.one2many):

def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
    if context is None:
        context = {}
    if not values:
        values = {}
    res = {}
    for id in ids:
        res[id] = []
    ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids),('state', '=', 'open')], limit=self._limit)
    for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
        res[r[self._fields_id]].append( r['id'] )
    return res

class res_partner(osv.osv):

_inherit = 'res.partner'
_columns = {
    'partner_scheduled_calls': one2many_mod2('crm.phonecall', 'partner_id', 'Scheduled Calls', ),

}

this will filter the scheduled calls(('state', '=', 'open')) only from all call logs.

Hope this will help

0
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How to Set Fixed Filter for a User / User group ?
domain v7
الصورة الرمزية
الصورة الرمزية
1
أغسطس 15
6649
limited choose list depented on another
domain one2many
الصورة الرمزية
الصورة الرمزية
1
يونيو 15
4682
On_change domain on one2many field
domain one2many
الصورة الرمزية
الصورة الرمزية
2
يونيو 15
4342
V 7 - One2Many form view
one2many v7
الصورة الرمزية
0
مارس 15
3705
domain on a field in computed one2many
domain one2many computed-fields
الصورة الرمزية
0
سبتمبر 24
1938
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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