Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • 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:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Required fields problem in a model with different stages

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
fieldsrequired
1 Ответить
8144 Представления
Аватар
rosey

I have five stages in hr.recruitment.

In each have many required fields.

I added required="true" in each field.

I added datas in the first stage & save. But it shows error that remaining stages required fields are empty.

I want the same procedure, But how can i solve the issue?

ie, Datas in the first stage added there, then save. Only when i click the second stage, required fileds of second stage give that time only.

After initial qualification, next first stage then second stage. In initial qualification both tab are invisible, when i click first stage the offer letter field should be required, when i click second stage the passport field should be required.

<page string="First Stage" attrs="{'invisible':[('state','=','draft')]}"> <group> <field name="offer_letter" required="1"/> </group> </page>

<page string="Second Stage" attrs="{'invisible':[('state','in',('draft','pending'))]}"> <group> <field name="passport" required="1"/> </group> </page>

0
Аватар
Отменить
Аватар
Ayyappan
Лучший ответ

Try below one:

<field name="field_2" attrs="{'required':[('stage','=','two')]}"/>

If stage is in second, field_2(second field) must be in required. Otherwise should be in un-required state.


I have done the below code depends on state:

<page string="First Stage" attrs="{'invisible':[('state','=','draft')]}"> 
    <group> 
        <field name="offer_letter" attrs="{'required':[('state','=','draft')]}"/> 
    </group> 
</page>
<page string="Second Stage" attrs="{'invisible':[('state','in',('draft','pending'))]}"> 
    <group> 
        <field name="passport" attrs="{'required':[('state','=','pending')]}"/> 
    </group> 
</page>

In draft state: "offer_letter" field is required In pending state: "passport" field is required


In pyhton:

_columns = { 
'stage': fields.selection([
            ('stage_1', 'Start Qualification'),
            ('stage_2', 'First Qualification'),
            ('stage_3', 'Second qualification'),
            ('stage_4', 'Before finalisation'),
            ('stage_5', 'Finalised'),            
            ], 'Stage'
            ),
'field_1': fields.char('Field_1', size=64),
'field_2': fields.char('Field_2', size=64),
'field_3': fields.char('Field_3', size=64),
'field_4': fields.char('Field_4', size=64),
'field_5': fields.char('Field_5', size=64),
}
_defaults = {
        'stage': 'stage_1',     
        }

In xml:

<page string="First Stage"> 
    <group> 
        <field name="field_1" attrs="{'required':[('stage','=','stage_1')]}"/> 
    </group> 
</page>
<page string="Second Stage"> 
    <group> 
        <field name="field_2" attrs="{'required':[('stage','=','stage_2')]}"/> 
    </group> 
</page>  
<page string="Third Stage"> 
    <group> 
        <field name="field_3" attrs="{'required':[('stage','=','stage_3')]}"/> 
    </group> 
</page>  
<page string="Fourth Stage"> 
    <group> 
        <field name="field_4" attrs="{'required':[('stage','=','stage_4')]}"/> 
    </group> 
</page>  
<page string="Fifth Stage"> 
    <group> 
        <field name="field_5" attrs="{'required':[('stage','=','stage_5')]}"/> 
    </group> 
</page>

If you use like this, in your status bar consists 5 stages. Beginning of the flow stage is stage_1(Start Qualification) in this stage Field_1 is required, then when you click the stage_2(First Qualification) - Field_2 is required..., and the flow goes likewise.

0
Аватар
Отменить
Remya

Uncaught Error: Unknown field stage in domain [["stage","=","two"]]. Its shows the error

Ayyappan

Above i just gave example code. If you need full functionality code, give me your files or fields details.

Remya

i updated my question, please check it.

Remya

Any solution?

Ayyappan

Can you please explain the stage? I think state field is stage. Here i explain with state.

Remya

Ok its working.

rosey
Автор

Still have a doubt. I have three stage with same status type. ie, third stage, fourth stage, fifth stage. each three is status=hired. But each three stage has different fields. What will do? Please reply

Ayyappan

In same state it is not possible. You just add another two states. Otherwise in hired state all remaining fields will be in required state.

rosey
Автор

But my requirement is that. What will do? Any way to solve this?

Ayyappan

After second stage what you want to do? Give a summary of your work. Otherwise how can i help you. In the beginning of the third stage you want one field should be required. right? and you will save the form another field should be required. is it correct?

rosey
Автор

I'll explain you. I have 5 stages. In each stage i have some required field. First stage status=draft, 2nd,3rd are pending, 4th,5th are hired. In 2nd stage i have three required fields and in 3rd stage 5 required fields. same as in 4th&5th. How can i update my code? <field name="passport" attrs="{'required':[('state','=','pending')]}"/> if i give like this, it will affect 2nd & 3rd, right?

Ayyappan

What is the difference between 2nd & 3rd stage, and 4th & 5th stage? How do you mention it is 2nd and 3nd stage? Is there any process between 2nd and 3rd?

rosey
Автор

Yes. Stage names are different. 2nd=First Qualification---here we check some details and add it. if he qualified. then goes to 3rd=Second qualification---here we add some other details of the candidate. 4th=Before finalisation---here we add salary details. 5th=Finalised---here add bank details &some datas.

rosey
Автор

Both the 2nd&3rd 4th&5th different. Only status is same. 2nd&3rd-pending. 4th&5th-hired.

Ayyappan

Ok. Here you have mentioned "First Qualification", "Second qualification", "Before finalisation", "Finalised". right? Is there any field to get this value? How the process goes to "Second qualification" from "First Qualification"? Do you click any button to change the stage?

rosey
Автор

On status bar in the hr.applicant

Ayyappan

In status bar look like this? First Qualification>Second qualification>Before finalisation>Finalised. Is it selection field?

rosey
Автор

Just like that.

Ayyappan

Give me the status bar field name and what are the fields you want to hide in the particular state.

rosey
Автор

it is a large portion, and is with my senior. i just want to find out a solution for this. Can you just image some fields,please?

Remya

It is fine. Another help. How can i hide a <page> string like this? I have five page tab in the same <notebook>. 1st page is seen in stage_1=draft. 2nd page is seen i stage_2=pending. 3nd page is seen i stage_3=pending. 4th page is seen in stage_4=hired. 5nd page is seen i stage_5=hired. Stage names are same as above. Can you please suggest any code?

Ayyappan

Hi Remya, I want to know about stage and state. is it same field? or different field? Do you mention a state is stage?

Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
Required Fields in view Kanban Odoo13
fields required kanban_state
Аватар
0
июн. 22
2370
Skipping required fields
fields one2many required
Аватар
Аватар
1
окт. 19
5701
how to make a field compulsory only at a certain stage odoo Решено
fields help required
Аватар
Аватар
Аватар
3
апр. 18
5887
How to display a red * for required fields
fields
Аватар
Аватар
Аватар
Аватар
3
мая 25
3174
How to display a red * for required fields
fields
Аватар
Аватар
1
апр. 25
2288
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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

Odoo – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

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