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

Subcontracting location doesn't unreserve stock when order is cancelled

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
stockinventoryresupplyv15
2 Odpowiedzi
3202 Widoki
Awatar
Kacper Kucharski

I'm working with v15. When order which requires resupply order is cancelled the stock that was initially reserved from subcontracting location stay reserved (the available quantity doesn't go up) which creates an overstocking of components on the supplier side. Cancelling the PO, MO and SO doesn't change it at all. On hand quantity doesn't change. How can the stock be unreserved when order is cancelled?

0
Awatar
Odrzuć
Jaideep

To ensure understanding, is the reference to subcontract orders, that have been cancelled after the material has been transferred to supplier or prior to validating transfer?

Kacper Kucharski
Autor

We keep some stock in the subcontracting location, available for the supplier to use when orders come in, so when it's available the resupply order isn't raised and the stock is taken from that location. So when the order is raised that stock is reserved and when cancelled it stays reserved, but the On hand quantity stays the same. Hope this explains.

Awatar
Midhun M M
Najlepsza odpowiedź

Actually odoo have some resevation issues still they are not rectified. We are in Odoo 16 EE.

Whenever reservation issues are coming we need to run the server actions given by Odoo as temporoy solution.

There is no reply after that..!

Component Reservation Issue

------------------------------------

# Available variables:
#  - env: Odoo Environment on which the action is triggered
#  - model: Odoo Model of the record on which the action is triggered; is a void recordset
#  - record: record on which the action is triggered; may be void
#  - records: recordset of all records on which the action is triggered in multi-mode; may be void
#  - time, datetime, dateutil, timezone: useful Python libraries
#  - float_compare: Odoo function to compare floats based on specific precisions
#  - log: log(message, level='info'): logging function to record debug information in ir.logging table
#  - UserError: Warning Exception to use with raise
#  - Command: x2Many commands namespace
# To return an action, assign: action = {...}

quants = env["stock.quant"].search([])

move_line_ids = []

warning = ""

for quant in quants:

    move_lines = env["stock.move.line"].search(

        [

            ("product_id", "=", quant.product_id.id),

            ("location_id", "=", quant.location_id.id),

            ("lot_id", "=", quant.lot_id.id),

            ("package_id", "=", quant.package_id.id),

            ("owner_id", "=", quant.owner_id.id),

            ("reserved_qty", "!=", 0),

        ]

    )

    move_line_ids += move_lines.ids

    reserved_on_move_lines = sum(move_lines.mapped("reserved_qty"))

    move_line_str = str.join(

        ", ", [str(move_line_id) for move_line_id in move_lines.ids]

    )



    if quant.location_id.should_bypass_reservation():

        # If a quant is in a location that should bypass the reservation, its `reserved_quantity` field

        # should be 0.

        if quant.reserved_quantity != 0:

            quant.write({"reserved_quantity": 0})

    else:

        # If a quant is in a reservable location, its `reserved_quantity` should be exactly the sum

        # of the `reserved_qty` of all the partially_available / assigned move lines with the same

        # characteristics.

        if quant.reserved_quantity == 0:

            if move_lines:

                move_lines.with_context(bypass_reservation_update=True).write(

                    {"reserved_uom_qty": 0}

                )

        elif quant.reserved_quantity
            quant.write({"reserved_quantity": 0})

            if move_lines:

                move_lines.with_context(bypass_reservation_update=True).write(

                    {"reserved_uom_qty": 0}

                )

        else:

            if reserved_on_move_lines != quant.reserved_quantity:

                move_lines.with_context(bypass_reservation_update=True).write(

                    {"reserved_uom_qty": 0}

                )

                quant.write({"reserved_quantity": 0})

            else:

                if any(move_line.reserved_qty
                    move_lines.with_context(bypass_reservation_update=True).write(

                        {"reserved_uom_qty": 0}

                    )

                    quant.write({"reserved_quantity": 0})



move_lines = env["stock.move.line"].search(

    [

        ("product_id.type", "=", "product"),

        ("reserved_qty", "!=", 0),

        ("id", "not in", move_line_ids),

    ]

)



move_lines_to_unreserve = []



for move_line in move_lines:

    if not move_line.location_id.should_bypass_reservation():

        move_lines_to_unreserve.append(move_line.id)



if len(move_lines_to_unreserve) > 1:

    env.cr.execute(

        """

            UPDATE stock_move_line SET reserved_uom_qty = 0, reserved_qty = 0 WHERE id in %s ;

        """

        % (tuple(move_lines_to_unreserve),)

    )

elif len(move_lines_to_unreserve) == 1:

    env.cr.execute(

        """

        UPDATE stock_move_line SET reserved_uom_qty = 0, reserved_qty = 0 WHERE id = %s ;

        """

        % (move_lines_to_unreserve[0])

    )



Unreserve Quont

---------------------

# Available variables:
#  - env: Odoo Environment on which the action is triggered
#  - model: Odoo Model of the record on which the action is triggered; is a void recordset
#  - record: record on which the action is triggered; may be void
#  - records: recordset of all records on which the action is triggered in multi-mode; may be void
#  - time, datetime, dateutil, timezone: useful Python libraries
#  - float_compare: Odoo function to compare floats based on specific precisions
#  - log: log(message, level='info'): logging function to record debug information in ir.logging table
#  - UserError: Warning Exception to use with raise
#  - Command: x2Many commands namespace
# To return an action, assign: action = {...}

for record in records:
  if record.reserved_quantity > 0:
    record.write({'reserved_quantity':0})


FG Lot Generation Issue

--------------------------

# Available variables:
#  - env: Odoo Environment on which the action is triggered
#  - model: Odoo Model of the record on which the action is triggered; is a void recordset
#  - record: record on which the action is triggered; may be void
#  - records: recordset of all records on which the action is triggered in multi-mode; may be void
#  - time, datetime, dateutil, timezone: useful Python libraries
#  - float_compare: Odoo function to compare floats based on specific precisions
#  - log: log(message, level='info'): logging function to record debug information in ir.logging table
#  - UserError: Warning Exception to use with raise
#  - Command: x2Many commands namespace
# To return an action, assign: action = {...}

env.cr.execute("""UPDATE stock_move_line sml SET reserved_uom_qty = 0, reserved_qty = 0 WHERE sml.move_id in (select a.move_id from (select production_id,sm.id as move_id from stock_move sm JOIN mrp_production mp on mp.id = sm.production_id where mp.state in ('to_close','progress','confirmed'))a) ;""")



0
Awatar
Odrzuć
Kacper Kucharski
Autor

That's very interesting so it could not be related to our setup after all. I'll try this and see if it helps. Thanks a lot.

Awatar
Jaideep
Najlepsza odpowiedź

Did create  use case and tested, it seems to work as intended. 

Created 2 PO's for subcontract product and then validated the component transfers to subcontract location. Post that went out to cancel one of the orders (the PO and also ensured the associated Inventory receipt were cancelled). 




The products (components) in sub-contract location were no longer reserved. The on-hand qty wouldn't change as the component didn't get consumed, however the available qty were updated.


From your post it seems the expectation is for on hand Qty to increase. Could you confirm if you mean the on-hand qty in WH/Stock or Sub-contract location to increase? On cancelling an order there are no transfers generated only reservation is impacted.


Could you also confirm if you are using odoo default routes and locations or they have been modified? With default routes, the resupply route is always triggered irrespective of available component stocks in subcontract location.

0
Awatar
Odrzuć
Kacper Kucharski
Autor

Thank you for your answer. I'm referring to the Available qty, the On Hand qty stay the same as it should. The routes were modified quite a lot by a person who worked here before and I'm trying to bring them back to the default settings as it's causing other problems as well. It's very helpful to know that this works fine with default routes. From what I can see comparing our current setup to runbot, Resupply Subcontractor on Order supply method was changed to 'Take from Stock, if unavailable trigger another rule' and Resupply Subcontractor Source location was changed from WH/Stock to WH/Output. Possibly one of them changes is the source of the issue.

Jaideep

If the available qty does not update in subcontract location then I would look at the receipt operation (for the finished product from sub contractor), this is the operation that is reserving the components.

If the available qty does not update in WH/ Stock location (in the event order was cancelled prior to components being transferred to subcontractor) then I would look at re-supply subcontractor operation. Additionally since your modified route is output and in the event of unavailability at output location it is likely another operation is triggered Stock to Output.

Change of supply method and source location on the resupply route still doesn't explain how an operation is not triggered if components are available at subcontract location.
- The rule
>>> When products are needed in Physical Locations/Subcontracting Location, Resupply Subcontractor are created from WH/Stock to fulfill the need.
If the products are not available in WH/Stock, a rule will be triggered to bring products in this location.<<<

Each time a subcontract order is created this route would be triggered, to reserve product in WH/stock. If you wish Odoo to reserve the component already at subcontract location, then the source location needs to be Physical Locations/Subcontracting Location and if unavailable trigger another rule.

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ść
Reabastecimiento de almacenes que no compran
inventory resupply v15
Awatar
0
cze 23
2768
Allocate a quantity of stock for my sellers Rozwiązane
stock inventory v15
Awatar
Awatar
2
gru 21
3561
Issue with quantity available - Odoo 15
stock inventory stock_picking v15
Awatar
Awatar
Awatar
2
cze 23
3595
Inventory adjustment Rozwiązane
stock inventory adjustment v15
Awatar
Awatar
2
sie 24
3590
How to solve this error Field `show_check_availability` does not exist ?
stock inventory
Awatar
0
lip 24
2862
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