Перейти к содержимому
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
Об этом форуме
Помощь

How to configure the scheduled action to automate the manufacturing orders from confirmed state to done state

Подписаться

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

Этот вопрос был отмечен
Manufacturing OrderAutomatedActionsscheduledactionodoo16features
3 Ответы
6890 Представления
Аватар
Zahra Naveed

here is a code i am using in the scheduled action this code run perfectly if i run this manually but it didnot work every min.

i am accessing the  mrp.production this module in the selection

orders = env['mrp.production'].search([('state', 'in', ['confirmed', 'to_close'])])


for order in orders:

​ order.write({

​ 'qty_producing': order.product_qty,

​ })

​ move_lines = order.move_raw_ids

​ for move in move_lines:

​ move.write({

​ 'quantity_done': move.product_uom_qty,

​ })

​

​ order.write({

​ 'state': 'done',

​ })


image of my settings​

https://drive.google.com/file/d/1Lh1XkGNDKr7WHBNM4ttE6NnqNk6bKx37/view?usp=sharing

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

Hi krakalien,

why are you using Scheduled Action? Why not Automated Action, if it's going to have impact on all confirmed or to_close manufactured orders?

check this out:


BG,

Hamid - bitigloo GmbH

1
Аватар
Отменить
Zahra Naveed
Автор

i used this method but it did not give any output nor error.

Hamid Ahmadimoghaddam

it's weird, because I tested it in different scenarios before posting it, and again now, it's working for me. To be on the safe side, make sure your scheduled action is not active, when you are doing this.

Zahra Naveed
Автор

thanks its working for me as well i didn't see before you removed the first line of code.

Аватар
Cybrosys Techno Solutions Pvt.Ltd
Лучший ответ

Hi,

To run the scheduled action for every minute you can create an XML file to define the scheduled action. In this XML file, you'll specify the model, method, and cron expression for the scheduled action. For example,

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- Scheduled Action Definition -->
        <record id="ir_cron_send_email" model="ir.cron">
            <field name="name">Send Email Every Minute</field>
            <field name="model_id" ref="model_mrp_production"/>
            <field name="state">code</field>
<field name="code">model.automate_mrp_order()</field>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
            <field name="numbercall">-1</field>
            <field name="doall" eval="False"/>
            <field name="active" eval="True"/>
        </record>
    </data>
</odoo>


In this XML file, we define an ir.cron record with the necessary details for the scheduled action. It specifies the model (model_mrp_production), the Python method (model.automate_mrp_order()), and that it should run every minute (interval_number and interval_type).


And inside the python method you can define your code

def automate_mrp_order(self):

orders = env['mrp.production'].search([('state', 'in', ['confirmed', 'to_close'])])

for order in orders:

order.write({

'qty_producing': order.product_qty,

})

move_lines = order.move_raw_ids

for move in move_lines:

move.write({

'quantity_done': move.product_uom_qty,

})

order.write({

'state': 'done',

})


Refer this below blog to know more details about how to create a scheduled action

Scheduled Action


Hope it helps


0
Аватар
Отменить
Zahra Naveed
Автор

thank you but i cant access the backend code so cant write the xml code or .py code in the backend i am just using frontend to do this task.

Аватар
Lars Aam
Лучший ответ

I did this in V14. I wanted an automated action, but was not able to make it work.   SO I ended up witj a scheduled action running every 1 minute.

When you process 'Mark as Done', Odoo perform several actions in the background (as posting stock movements) as well as check that all is OK in the manufacturing order.  

The little pyhton code I have that calls the method is:

model.search([('state', '=', 'to_close')]).button_mark_done()

And it runs on Model production order (of course). 

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

Hi Lars, the action of the button will not work when you need to force the consumption of the components, because in the standard way, in this case, Odoo will show a wizard to the user. I don' remember if we had the wizard in Odoo14 or not, but in the later versions, you can also check.

Lars Aam

As far as I can read from your code, you fill the consumed and produced qty = to planned. If you keep that part of the code and then runnteh action "button_mark_done" you should be able to process without raising the warning. But still keep tha checks Odoo have in this action.

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

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

Регистрация
Похожие посты Ответы Просмотры Активность
Odoo16: where is Automated Actions in Technical menu Решено
AutomatedActions odoo16features
Аватар
Аватар
Аватар
Аватар
3
окт. 23
4139
Manufacturing Order: automated State change when adding Lot/Serial Number Решено
Manufacturing Order AutomatedActions
Аватар
1
янв. 23
3046
ValueError: <class 'psycopg2.ProgrammingError'>: "can't adapt type 'mail.activity.type'" Решено
activity AutomatedActions odoo16features
Аватар
1
авг. 23
3642
ValueError: [class 'psycopg2.ProgrammingError']: "can't adapt type 'ir.model'" while evaluating Решено
activity AutomatedActions odoo16features
Аватар
Аватар
1
авг. 23
4384
Is it possible to lock Serial Numbers on MOs before Validating? Решено
Manufacturing Order Lots/Serial odoo16features
Аватар
Аватар
1
мар. 23
3261
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • 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