Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Can I modify MPS to create draft state Manufacturing orders

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
manufacturingmpsv14
4 Odpowiedzi
11261 Widoki
Awatar
Bruno Rocha

Hello,

Someone out there that know if it is possible to change the state of the MO generated by Odoo in the MPS?

By default they are generated confirmed, can they be generated in draft?


Thnxs

1
Awatar
Odrzuć
Leonardo de Abreu Ladeira

How did you solve this?

Awatar
Ray Carnes (ray)
Najlepsza odpowiedź

You can do this via the Automation Framework using a custom field, an automated action, a custom view and a server action.


Consider this a proof of concept that you may need to modify based on your needs.  It has been quickly tested based on manually created, MTO created and scheduler/order point created MO's but may still need further improvements to support all workflows. Contact your Odoo Consultant or an Odoo Partner if you need more help.


1. From the Fields Menu, create a custom boolean field Released which will prevent confirmation of a manufacturing order if false (the default value) and allow it if true:



2. From the Views Menu, create a custom View to add this field to the Form View of Manufacturing Orders:



<field name="product_id" position="before">
<field name="x_released"/>
</field>


Note: you can also use Odoo Studio to both create and add the field to the UI at the same time, see the References section at the end for more information.


3. From the Automated Actions Menu, create a custom action that prevents Manufacturing Orders from being confirmed if the value of x_released is false:



for record in records:
if not record.x_released:
record['state'] = 'draft'


4. From the Server Actions Menu, create a custom action that allows Users to release Manufacturing Orders:


Note: when you create this action, look in the URL to find the ID of it as you will need it in the next step.  



5. Finally, edit the custom View made in the second step to add a button that runs the Server Action and hide the Confirm button until the MO is released:



<button name="action_confirm" position="before">
<button name="458" attrs="{'invisible': ['|',('x_released', '=', True),('state','=','cancel')]}" string="Release" type="action" class="oe_highlight"/>
</button>

<button name="action_confirm" position="attributes">
<attribute name="attrs">{'invisible': ['|',('state', '!=', 'draft'),('x_released', '!=', True)]}</attribute>
</button>


Note: the ID of the Server Action was 458 - yours will be different, so change this number to the number you found during the fourth step.




What you end up with is Manufacturing Orders that are initially created in Draft mode:



When you open each MO, you will see that the CONFIRM button is hidden until you click the new RELEASE button:



Click both buttons to confirm the Manufacturing Order.



References:

https://www.odoo.com/documentation/14.0/applications/productivity/studio/concepts/understanding_automated_actions.html

https://www.odoo.com/documentation/14.0/applications/productivity/studio/use_cases/models_fields.html


 

6
Awatar
Odrzuć
Leonardo de Abreu Ladeira

Ray Carnes,
Thank you this is a beautiful solution. I have one question however, if let's say a component on the bom has the routes of purchase and replenish on order, the request for quotation is still created.

Is there the possibility to block that as well, until the manufacturing order is confirmed?

Best regards,

Ray Carnes (ray)

Yes, please contact your Odoo Consultant or Odoo Partner for help with this.

Gary Baughman

I was able to make this work with a slight modification for v14. The lines from step 5, I added to the <header> section of the form. It does not create a "Release" button but does keep the Manufacturing Order in Draft mode and once the order is to your liking, you press "Confirm" to lock it.

Maurice Moretti

Hello Ray,

this sounds good for a technical guy, but for a functional one as myself it is quite weird
Why is the MO not created in Draft state by the MPS (as the PO for example)
At least it should be configurable so that the use can decide whicg behaviour best fits

Regards
Maurice

Dries Kooistra

I tested this for Odoo 14 and it works like a charm. This procedure can be followed with the same steps in Odoo 13 and the steps do not look any different to Odoo 14. However, in Odoo 13 it is not leading to a 'draft' state of the MO.

Any idea's on why the automated action does act differently in Odoo 13?

Ray Carnes (ray)

I just tested in v13 and it works the same way - please start over and check your work - you likely have missed a step or made a small mistake somewhere.

Dries Kooistra

Tried it again on v13 and seems to work indeed. Thanks for the solution in general and for checking it in v13 too!

Tim Drinkwater

I was hoping to use this modification to allow selecting the BOM. I was able to perform this modification successfully and the MO generated via automation remains in a draft state. However when I change to a different BOM and attempt to save I get an errror:
"You can only delete draft moves."
Can this method be modified/enhanced to allow selecting a different BOM prior to confirmation?

Juan P.C.

Hey,

Though the initial idea is good, I found problems when using this approach:

- You will have problems if your MO needs to launch new MOs. Let's say that you have Prod1 = Part1+Part2, all of them manufacturable. If you launch MO/1 for Prod1 when confirmed, it will launch MO/2 and MO/3 for Part1 and Part2, initially blocked. If you don't release MO/2 and 3, and in the meanwhile, you launch a new MO for Prod1, (MO/4), it won't generate new MO for Parts 1 and 2, nor add units on the existing (blocked) ones. However, it will generate new MO if MO/2 and 3 are released.

-Additionally, it does something to the existing MO/2 and MO/3, as it modifies its last updated time. However, it does not change their due quantity.

I did not test what happens with Purchase Orders, but I can anticipate a similar behaviour.

Using Odoo 14 Online.

Nicu Constantin

Hey Ray! Thanks for sharing it with us!
I did step by step, and indead the MO are created in draft state
But if i try do edit quantity or change the bom is giving the error: "You can only delete draft moves."
The version of odoo is V16
Any help will help us (seems that others faced the same)

Ray Carnes (ray)

Many Users have found that create an empty Bill of Materials is far easier. If this is the first in the sequence of BoM's for a product (drag it to the top of the list) then the MO will always be created in draft. You can read a forum post about this approach at https://www.odoo.com/forum/help-1/how-to-generate-a-manufacturing-order-in-draft-status-from-a-sales-order-using-mto-215627

Awatar
Gastemirova Milana (mgi)
Najlepsza odpowiedź

Hello there,

An easy work around would be to add an empty BoM as the first bom to your product that is set up with MTO. That way, the MO triggered will be in Draft. Then you can select the correct bom and confirm the MO as you please. 

1
Awatar
Odrzuć
Awatar
Hayden McCarthy
Najlepsza odpowiedź

Posting here to bump Tim Drinkwater's comment. Has anyone been able to figure out this part?

My understanding is that the MTO rule creates stock moves in confirmed state. I am trying to create an automated action to force them into draft state, similar to Ray's solution for the production order. Here's what I have come up with for python code in an automated action targeting the stock.move model. It needs work (I think my syntax is bad) but it could help as a good starting point:

for record in self:
if self.env['mrp.production'].search('name', '=like', 'record.reference') == 'draft':
record['state'] = 'draft'

0
Awatar
Odrzuć
Nicu Constantin

Hey Hayden!
Did u succes to find a solution?
Ray's solution, is indead creating my MO in draft mode, but i cannot update/edit the bom , as is giving me the error "You can only delete draft moves." , why is this error, as anyway the MO is in draft mode?! Why i should not be able to delete it?

Hayden McCarthy

@Nicu Constantin The only way I have been able to do this is by first setting the associated 'Stock Moves' to draft state before changing the BOM. To do this is a bit convoluted but I will explain how:
1. Enable developer mode
2. Create a server action on the Stock.Move object called something like "Move: Force Draft". Set it to execute the following python code: 'for record in records:
record['state'] = 'draft''
3. Create a contextual action for the server action.

Now everything is set up, each time you want to change a BOM, you have to do the following (Note, you must be in developer mode to do this):
1. Go to 'Inventory > Reporting > Stock Moves'. Look for the moves with 'reference' value that matches the MO you want to change.
2. Open the stock moves and hit the action button - run the "Move: Force Draft" action. Do this for each move associated with the MO.
3. Once all moves are draft, you should be able to change the BOM on the MO.

You can try to create an automation to force stock.move to be created in draft, similar to what Ray did in point #3 of his answer, but for whatever reason I did not have any luck with this. Hope this helps!

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Adjust quantity of Manufacturing Order
manufacturing v14
Awatar
Awatar
2
sie 22
5749
Using same Product in the BoM of the the product Rozwiązane
manufacturing v14
Awatar
Awatar
1
mar 22
3220
Modifying Report View For Upgrades
manufacturing v14
Awatar
Awatar
1
lut 22
3060
Mass Update Manufacturing Order State Values
manufacturing v14
Awatar
Awatar
1
lut 22
3598
Forecast not showing for components of sub BOM
manufacturing v14
Awatar
0
cze 21
2932
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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