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

selection field values in data.xml?

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
v7selectiondata.xml
2 الردود
21942 أدوات العرض
الصورة الرمزية
mike

Is it possible to populate the values of a selection field from the data.xml file? I have been going through the ~data.xml files for various addons looking for an example of this and have found none. Or maybe I have and it wasn't obvious to me. Are there any good examples of this if it is possible?

I just discovered this in crm_lead_data.xml...

<record model="crm.case.section" id="section_sales_department">
    <field name="stage_ids" eval="[ (4, ref('stage_lead1')), (4, ref('stage_lead2')),
                                    (4, ref('stage_lead3')), (4, ref('stage_lead4')),
                                    (4, ref('stage_lead5')), (4, ref('stage_lead6')),
                                    (4, ref('stage_lead7')), (4, ref('stage_lead8'))]"/>
</record>

I am trying to understand how the module uses it but it looks like it might be what I am trying to do ....maybe.

0
الصورة الرمزية
إهمال
الصورة الرمزية
Dharmesh Rathod
أفضل إجابة

hi,

Are you going to create records from XML and trying to filling selection field ?

thanks

1
الصورة الرمزية
إهمال
mike
الكاتب

Hi, I want to use data from XML as default values for the selection field. In my case requirements specifies an address field for County but the business area only includes 14 counties in the state. But the business area may expand to include more counties and states. They want to be able to add new Counties to an XML file as needed.

Ray Carnes

I think it might be better to define a new model that stores county names. Then you can add new ones via the UI or via XML or via CSV as needed. You can then relate (via a many2one field) this model to the partner so it can be part of the address.

mike
الكاتب

Yes, I agree. After looking how the state and country fields are based on models through many2one it would make sense to incorporate counties the same way. Then when they need to add counties for other states the county and state models can reference one another. However, in bringing across legacy data from an old app there are very many pesky little lookup tables with mostly static data which I don't see a reason to model but yet wouldn't want to hard-code as global constants. Any suggestions for these?

الصورة الرمزية
mike
الكاتب أفضل إجابة

Ok Dharmesh and Ray, I think I see the light (in OpenERP colors). I need a model for each of my pesky lookup tables. Then based on the XML snippet I posted above I create the records as found in crm_lead_data.xml e.g.

<!-- Crm stages -->
<record model="crm.case.stage" id="stage_lead1">
    <field name="name">New</field>
    <field eval="1" name="case_default"/>
    <field name="state">draft</field>
    <field eval="'10'" name="probability"/>
    <field eval="'10'" name="sequence"/>
    <field name="type">both</field>
</record>

Then implement a "default loader" as in crm.py e.g.

def _get_stage_common(self, cr, uid, context):
    ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context)
    return ids

_defaults = {
    'active': 1,
    'stage_ids': _get_stage_common,
    'alias_domain': False, # always hide alias during creation
}

And define the proper column type e.g.

_columns = {
'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
}

And after all this I'll have a field that can hold selectable values which can be updated via the data.xml file. Is this correct?

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

Country table is already exist into openerp. You can add missing one by xml.

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How to use selection on many2one?
many2one v7 selection
الصورة الرمزية
الصورة الرمزية
2
مارس 15
15331
How to add a "Delete" button on the popup form? تم الحل
v7
الصورة الرمزية
الصورة الرمزية
1
أكتوبر 25
5870
Minimum Lot Charge For Sales Order Line Items
v7
الصورة الرمزية
0
ديسمبر 24
10663
Record Rule to allow a User to update their own Employee object without belonging to Officer group تم الحل
v7
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
سبتمبر 24
23208
How to activate the Technical Features? تم الحل
v7
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
5
ديسمبر 24
55489
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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