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

cant call this func odoo, error :TypeError: update_groups() missing 1 required positional argument: 'uids'.

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
functionodoo
2 الردود
5802 أدوات العرض
الصورة الرمزية
trung

i make a module profile to add groups into profile. when make a new user, we can add profile for user profiles and user will auto authorized groups in profile. but i cant make user auto add groups from profile. cant someone help me pls. thanks a lot. i had thit error: TypeError: update_groups() missing 1 required positional argument: 'uids'.

There is my code: profile.py



# -*- coding: utf-8 -*- from odoo import models,fields, api,tools import string from odoo.tools.translate import _ class Users(models.Model): _inherit = 'res.users' profile_id = fields.Many2one('res.profiles',string="Profile") profiles_ids = fields.Many2many('res.profiles','profile_user_rel','user_id','profile_id', string='Profile Name') def update_groups(self,uids): users_pool = self.env["res.profiles"] if uids: for user in users_pool.browse(uids): if not user.profiles_ids and user.id != 2: user.write({'groups_id':[[6,0,[]]]}) if user.profiles_ids: sql = """UPDATE FROM res_groups_users_rel WHERE uid = %s"""%(user.id) self._cr.execute(sql) groups_ids = [] for profile in user.profiles_ids: groups_ids += [x.id for x in profile.groups_ids if x.id not in groups_ids] user.write({'groups_id':[[6,0,groups_ids]]}) return True def update_profile(self): self.env["user.profiles"].update_groups(self.ids) return True class GroupInherit(models.Model): _inherit = 'res.groups' profiles_groups_ids = fields.Many2many('res.profiles','profile_group_rel','group_id','profile_id', string='Profile Name') class UserProfile(models.Model): _name = 'res.profiles' _description = 'Profile Record' _rec_name = 'profile_name' _sql_constraints = [('name_uniq','unique(name)', 'Profile name must be unique!'),] _order = "profile_name" profile_name = fields.Char(string='Name', required=True) groups_ids = fields.Many2many('res.groups','profile_group_rel','profile_id','group_id',string='Authorized Group') user_ids = fields.Many2many('res.users','profile_user_rel','profile_id','user_id', string='User Name') ``` profile.xml: ``` <?xml version="1.0" encoding="UTF-8"?> <odoo> <!-- tree view --> <record id="profile_tree" model="ir.ui.view"> <field name="name">user.profile.tree</field> <field name="model">res.profiles</field> <field name="arch" type="xml"> <tree string= "profile"> <field name="profile_name"/> <field name="user_ids"/> <field name="groups_ids"/> </tree> </field> </record> <!-- view form --> <record id="student_form" model="ir.ui.view"> <field name="name">user.profile.form</field> <field name="model">res.profiles</field> <field name="arch" type="xml"> <form string="Profile"> <sheet> <div class="oe_title"> </div> <group> <group><field name="profile_name"/></group> <group><field name="user_ids" widget="many2many_tags"/></group> <group><field name="groups_ids"/></group> </group> </sheet> </form> </field> </record> <!--action of the student menu--> <record id="action_profile" model="ir.actions.act_window"> <field name="name">Profile</field> <field name="type">ir.actions.act_window</field> <field name="res_model">res.profiles</field> <field name="view_mode">tree,form</field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Create First profile ! </p> </field> </record> <!-- profile name in group view --> <record id="group_inherit" model="ir.ui.view"> <field name="name">group.inherit</field> <field name="model">res.groups</field> <field name="inherit_id" ref="base.view_groups_form"></field> <field name="arch" type="xml"> <field name="name" position="after"> <field name="profiles_groups_ids"/> </field> </field> </record> <!-- profile name in user view --> <record id="user_inherit" model="ir.ui.view"> <field name="name">user.inherit</field> <field name="model">res.users</field> <field name="inherit_id" ref="base.view_users_form"></field> <field name="arch" type="xml"> <field name="login" position="after"> <field name="profiles_ids"/> </field> <field name="profiles_ids" position="after"> <div class='oe_button_box' name="button_box"><button name='update_groups' type="object" class="oe_stat_button" string="update"></button></div> </field> <button name="action_show_groups" position="attributes"> <attribute name="invisible">1</attribute> </button> <field name="groups_count" position="attributes"> <attribute name="invisible">1</attribute> </field> </field> </record> <menuitem id="profiles" name="User Profile" parent="base.menu_users" sequence="4" action="action_profile"/> <menuitem id="user_root" name="Profile" sequence="0"/> <menuitem id="user_profile" name ="Profile" parent="user_root" action="action_profile"/> </odoo> ```
0
الصورة الرمزية
إهمال
الصورة الرمزية
trung
الكاتب أفضل إجابة

Hi Hemangi Rupareliya, 

it cant be solved

i think my browse is wrong but i dont no how to fix

0
الصورة الرمزية
إهمال
Hemangi Rupareliya(rupareliyahemangi145@gmail.com)

Hello Trung,

Have you renamed the argument in following all lines?

1. def update_groups(self,uids):

users_pool = self.env["res.profiles"]

2. if uids:

3. for user in users_pool.browse(uids):

الصورة الرمزية
Hemangi Rupareliya(rupareliyahemangi145@gmail.com)
أفضل إجابة

Hello Trung,

Try to use another argument name instead of 'uids'.

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How To Calculate Age From Birthday تم الحل
function odoo odoo10.0
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
7
سبتمبر 21
29482
ODOO: FIELDS TYPE FUNCTION
function fields odoo
الصورة الرمزية
0
يوليو 16
5770
QWEB: How to call a function to test in odoo
function qweb odoo
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
يونيو 16
7543
(!!C-o-p-a!!)¿Cómo comunicarse con Copa Airlines en Panamá?
odoo
الصورة الرمزية
0
نوفمبر 25
211
How do I go about this error? I am trying to uninstall a module
odoo
الصورة الرمزية
0
نوفمبر 25
3329
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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