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

How to filter second selector depending on the answer of the first selector?

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
authenticationqwebsignupauth_signup
5 الردود
9858 أدوات العرض
الصورة الرمزية
Jesús Alan Ramos Rodríguez

I have been working in the singup form view where I define new fields that are selectors, I need that when you select the first field (Brand), the second shows data depending on the first selector (Brand/Model). To get the data from the database to the selectors I use.

<t t-foreach="request.env['fleet.vehicle.model.brand'].search([])" t-as="brand">

It works perfectly, but the problem is that I need the second selector only shows Models from the brand I selected in  the first selector.

How can I get the data from the first selector to use in a search([('brand_id', '=', brand_id)])?

There is on_change in website views?

I paste the code below:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="auth_signup_motomanic.fields"
inherit_id="auth_signup.fields"
name="Auth Signup/ResetPassword form fields">
<xpath expr="//div[@class='form-group field-confirm_password']" position="after">
<div t-attf-class="form-group #{error and 'brand_id' in error and 'has-error' or ''}">
<label class="control-label" for="brand_id">Brand</label>
<select name="brand_id" class="form-control">
<option value="">Brand...</option>
<t t-foreach="request.env['fleet.vehicle.model.brand'].search([])" t-as="brand">
<option t-att-value="brand.id" t-att-selected="brand.id == (int(brand_id) if brand_id else website.user_id.partner_id.vehicle_id.model_id.brand_id.id)">
<t t-esc="brand.name"/>
</option>
</t>
</select>
</div>
<div t-attf-class="form-group #{error and 'model_id' in error and 'has-error' or ''}">
<label class="control-label" for="model_id">Model</label>
<label class="control-label" for="model_id"><t t-esc="brand_id"/></label>
<select name="model_id" class="form-control">
<option value="">Model...</option>
<option value=""><t t-esc="request.params.copy()"/></option>
<t t-foreach="request.env['fleet.vehicle.model'].search([])" t-as="model">
<option t-att-value="model.id" t-att-selected="model.id == (int(model_id) if model_id else website.user_id.partner_id.vehicle_id.model_id.id)">
<t t-esc="model.name"/>
</option>
</t>
</select>
</div>
</data>
</openerp>

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

You need JS here.

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

Dude there is no on_change for the website templates, but here is a workaround that will work for you in JS:

     $("select[name='brand_id']").change(function(){

     var $select = $("select[name='model_id']");

     $select.find("option:not(:first)").hide();

     var nb = $select.find("option[data-brand_id="+($(this).val() || 0)+"]").show().size();

     $select.val(0);

     });

you also need to add this two atttributes to your selection field on his <option> tag: `style="display:none;" t-att-data-brand_id="model.brand_id.id"`


Hope it works, haven't tested on a real project.

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

Well you can use the attrs attribute of the field .Depending upon the value in the first selection box the value in the second box changes automatically . 

The demo code for simplifying your need is :

class selector(models.Model):

_name='select.selector'

selector1=fields.Selection([('BLY','Bareilly'),('NDA','Noida'),('DL','Delhi')],"Brands")

selector21=fields.Selection([('IU','Invertis University'),('SRMS','SRMS')],"Models")

selector22=fields.Selection([('GU','Galgotia University'),('AU','Amity')],"Models")

selector23=fields.Selection([('DCE','DU'),('IIT','IIT DELHI')],"Models")



View.xml

<group><field name="selector1"/></group>

<group><field name="selector21" attrs="{'invisible': [('selector1', '!=', 'BLY')]}"/>

<field name="selector22" attrs="{'invisible': [('selector1', '!=', 'NDA')]}"/>

<field name="selector23" attrs="{'invisible': [('selector1', '!=', 'DL')]}"/></group>

 



1
الصورة الرمزية
إهمال
الصورة الرمزية
Ray Carnes
أفضل إجابة

Checkout crm_claim - the module that does this:


0
الصورة الرمزية
إهمال
Jesús Alan Ramos Rodríguez
الكاتب

thanks for your response. The main problem is that Sign Up is a front end (Qweb) view. It's created with auth_signup module and Allow external users to sign up = True, I cannot upload a picture of the view but when you register name, email and password I added two new fields "Brand" and "Model" that are after "Confirm Password", when you select the brand the models related to that brand need to be shown in the second selector.

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How to Register new users on Odoo with Google
authentication auth_signup
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
ديسمبر 22
4006
An exception while creating new user signup. Record does not exist or has been deleted. None
signup auth_signup
الصورة الرمزية
الصورة الرمزية
1
مارس 18
6111
[V8] Google OAuth 2 and Sign up - how to make the work at the same time?
authentication google signup auth_signup resetpassword
الصورة الرمزية
0
أبريل 15
4558
How to add Country field in signup page?
login signup auth_signup
الصورة الرمزية
الصورة الرمزية
1
أبريل 25
4326
Help needed for authenticating users on Odoo16
authentication auth_signup authenticate
الصورة الرمزية
الصورة الرمزية
1
يوليو 23
3201
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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