تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (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 inherit <field name="is_published" widget="website_redirect_button"/> and add attributes to it, hr.job odoo 14

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
recruitmentjobv14
1 الرد
4313 أدوات العرض
الصورة الرمزية
Jay
I want to inherit the widget in the recruitment module under hr.job model and add one level record rule
restricting employees from publishing the job unless they're managers.

  • How can I go about this?
    Any assistance will be highly appreciated.





1
الصورة الرمزية
إهمال
الصورة الرمزية
Krys.Raj
أفضل إجابة

Hello Jay, how you're doing... 

I am here to help you.. maybe I will just paste here the working code and you will analyze it yourself after then.


The goal is to give the field right "groups" attribute. Then it will be only seen for this group. So for manager there is "group_hr_recruitment_manager" which comes from hr.recruitment module. So the code will be something like this.

<record id="view_hr_job_form_website_published_button_limited" model="ir.ui.view">
<field name="name">hr.job.form.inherit.published.button_limited</field>
<field name="model">hr.job</field>
<field name="inherit_id" ref="website_hr_recruitment.view_hr_job_form_website_published_button"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='website_published']" position="attributes">
<attribute name="groups">hr_recruitment.group_hr_recruitment_manager</attribute>
</xpath>
<xpath expr="//field[@name='is_published']" position="attributes">
<attribute name="groups">hr_recruitment.group_hr_recruitment_manager</attribute>
</xpath>
</field>
</record>

Explanation: 

1. inheriting the right view with the button included 

website_hr_recruitment.view_hr_job_form_website_published_button

2. using xpath for selection + position="attributes" to add additional attribute called "groups"

<xpath expr="//field[@name='website_published']" position="attributes">

3. putting the content of the attribute
<attribute name="groups">hr_recruitment.group_hr_recruitment_manager</attribute>

4. NOTICE: I have put this attribute to 2 fields as maybe it's wiser to hide both of these fields in the form
look at the screenshot -> https://ibb.co/kBjrWGC  

5. Now you can switch the Manager/Officer group for Recruitment module and only Managers will be able to see and use them.
look at the screenshot -> https://ibb.co/d0FnM0g

Hope this will help you a lot.
Please remember, to vote +1 👍 to my answer for the effort, and mark as Best Answer if it worked for you 😎


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

Thanks a lot, Krys.Raj, the answer is well explained and working perfectly well.
Thanks again, man.

Jay
الكاتب

Only one error below, kindly check.
odoo.exceptions.ValidationError: Error while validating view:

Element '<xpath expr="//field[@name='is_published']">', '<xpath expr="//field[@name='website_published']">' cannot be located in parent view

Krys.Raj

Will check in a minute up to 30 minutes will be back

Krys.Raj

Ok, the problem is I did it for Odoo 15, now after checking the soruce code od Odoo 14 I see there is no field with "name='website_published'" in this view you tries to inherit.. So remove this xpath:
<xpath expr="//field[@name='is_published']" position="attributes">
<attribute name="groups">hr_recruitment.group_hr_recruitment_manager</attribute>
</xpath>

Jay
الكاتب

Hi Krys.Raj,
I have removed the xpath and still getting this error:
odoo.exceptions.ValidationError: Error while validating view:

Element '<xpath expr="//field[@name='website_published']">' cannot be located in parent view

Krys.Raj
Or you have removed the wrong xpath... not the one with 'is_published' or you havent yet updated the module.. from App menu.. check it out.
You should be left only with one xpath
this one;
<xpath expr="//field[@name='website_published']">

so the code should be like this:

<record id="view_hr_job_form_website_published_button_limited" model="ir.ui.view">
    <field name="name">hr.job.form.inherit.published.button_limited</field>
    <field name="model">hr.job</field>
    <field name="inherit_id" ref="website_hr_recruitment.view_hr_job_form_website_published_button"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='is_published']" position="attributes">
            <attribute name="groups">hr_recruitment.group_hr_recruitment_manager</attribute>
        </xpath>
    </field>
</record>

and then update the module...

Oh, and the question is, how do you do it? With module? Have you created one? If you paste this code into the view of course it will generate the error.
Send me screenshot + more explanations..

On Nov 19 2021, at 11:32 am, Jay <jaymezon@gmail.com> wrote:

View Forum Post Odoo S.A.

Hi Krys.Raj,
I have removed the xpath and still getting this error:
odoo.exceptions.ValidationError: Error while validating view:

Element '<xpath expr="//field[@name='website_published']">' cannot be located in parent view
Sent by Odoo S.A. using Odoo.
Sent from Mailspring
Jay
الكاتب

Now showing this error:
Field "is_published" does not exist in model "hr.job"

Krys.Raj
Can you explain where do you paste it? Because if you modify the template directly in odoo it has no sense.. this will work only if you created a module and from that you inherit and load that view.

Screenshot, please! It will tell more than words :)

On Nov 19 2021, at 11:47 am, Jay <jaymezon@gmail.com> wrote:

View Forum Post Odoo S.A.

Now showing this error:
Field "is_published" does not exist in model "hr.job"
Sent by Odoo S.A. using Odoo.
Sent from Mailspring
Jay
الكاتب

I had commented this field in my inherited hr.job and the error is gone.
is_published = fields.Boolean('Is Published', copy=False, default=False)

Will this override the 'Go to Website' from here https://ibb.co/kBjrWGC ?

Jay
الكاتب

Also, it shouldn't allow employees to publish jobs from recruitment as well as shown here, circled part.
https://ibb.co/nByh6jY

Krys.Raj
hello jay I am back to the office... taking look into it
Sent from Mailspring
Krys.Raj
Jay are you there yet? My question is if you like it in the form of xpath full code or just telling you wich view you should modify and how?
Sent from Mailspring
Jay
الكاتب

xpath full code is fine Krys

Krys.Raj
I can record a video for you how to find how to find view you want to modify..
but now xpath -> ok 10 minutes.. had a guest in my office before.
Sent from Mailspring
Krys.Raj
Hello again, here is a link to the pastebin, as the forum code editor is a disaster
https://pastebin.com/smvUfnA3
What is important your manifest.py (if you do it with custom module) file should include dependency on "website_hr_recruitment" module
like this:
"depends": ["website_hr_recruitment"],
Then this xpath will work as you need.
If you do it in other way than custom module let me know
Sent from Mailspring
Jay
الكاتب

Code and explanations are fine Krys, no need for a video.

Jay
الكاتب

added this field in hr.job model:
is_published = fields.Boolean('Is Published', copy=False, default=False)

Will this override the 'Go to Website' from here https://ibb.co/kBjrWGC
and Also, it shouldn't allow employees to publish jobs from recruitment as well as shown here, circled part.
https://ibb.co/nByh6jY?

Krys.Raj
The code I have provided you is exactly doing the thing
https://ibb.co/8sWSg9B
You do not have to recreate the field. Yes, it will be override
Sent from Mailspring
Jay
الكاتب

Thanks a lot, Krys.Raj.
Working perfectly fine now.

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How to send email to multiple applicant via server action using python code in Odoo 14
recruitment job v14
الصورة الرمزية
0
أكتوبر 21
2916
How do I inherit a website page, Job Application Form in hr.job odoo 14 and add a field and add override submit button? تم الحل
recruitment controllers v14
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
يونيو 22
5480
Odoo 14, how to link job application form with the job's survey questions, so that applicant can fill the survey after applying for the job.
email recruitment v14
الصورة الرمزية
0
فبراير 22
3972
How to inherit the recruitment job application page website and add survey questions from the survey module associated with the job position in Odoo 14 recruitment module.
survey recruitment v14
الصورة الرمزية
0
ديسمبر 21
2493
Odoo 14EE Recruitment App Does Not Ask for Job Specific Email Address
email recruitment v14
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
مايو 21
3140
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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