Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
Manufacturing OrderAutomatedActionsscheduledactionodoo16features
3 Răspunsuri
6974 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Hamid Ahmadimoghaddam
Cel mai bun răspuns

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
Imagine profil
Abandonează
Zahra Naveed
Autor

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
Autor

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

Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

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
Imagine profil
Abandonează
Zahra Naveed
Autor

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.

Imagine profil
Lars Aam
Cel mai bun răspuns

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
Imagine profil
Abandonează
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.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo16: where is Automated Actions in Technical menu Rezolvat
AutomatedActions odoo16features
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
oct. 23
4248
Manufacturing Order: automated State change when adding Lot/Serial Number Rezolvat
Manufacturing Order AutomatedActions
Imagine profil
1
ian. 23
3090
ValueError: <class 'psycopg2.ProgrammingError'>: "can't adapt type 'mail.activity.type'" Rezolvat
activity AutomatedActions odoo16features
Imagine profil
1
aug. 23
3694
ValueError: [class 'psycopg2.ProgrammingError']: "can't adapt type 'ir.model'" while evaluating Rezolvat
activity AutomatedActions odoo16features
Imagine profil
Imagine profil
1
aug. 23
4452
Is it possible to lock Serial Numbers on MOs before Validating? Rezolvat
Manufacturing Order Lots/Serial odoo16features
Imagine profil
Imagine profil
1
mar. 23
3305
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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