Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

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

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
Manufacturing OrderAutomatedActionsscheduledactionodoo16features
3 Replies
6930 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Hamid Ahmadimoghaddam
Best Answer

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
Portretas
Atmesti
Zahra Naveed
Autorius

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
Autorius

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

Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Zahra Naveed
Autorius

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.

Portretas
Lars Aam
Best Answer

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
Portretas
Atmesti
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!

Registracija
Related Posts Replies Rodiniai Veikla
Odoo16: where is Automated Actions in Technical menu Solved
AutomatedActions odoo16features
Portretas
Portretas
Portretas
Portretas
3
spal. 23
4183
Manufacturing Order: automated State change when adding Lot/Serial Number Solved
Manufacturing Order AutomatedActions
Portretas
1
saus. 23
3078
ValueError: <class 'psycopg2.ProgrammingError'>: "can't adapt type 'mail.activity.type'" Solved
activity AutomatedActions odoo16features
Portretas
1
rugp. 23
3681
ValueError: [class 'psycopg2.ProgrammingError']: "can't adapt type 'ir.model'" while evaluating Solved
activity AutomatedActions odoo16features
Portretas
Portretas
1
rugp. 23
4425
Is it possible to lock Serial Numbers on MOs before Validating? Solved
Manufacturing Order Lots/Serial odoo16features
Portretas
Portretas
1
kov. 23
3288
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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