Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Subcontracting location doesn't unreserve stock when order is cancelled

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
stockinventoryresupplyv15
2 Replies
3196 Tampilan
Avatar
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
Avatar
Buang
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
Penulis

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.

Avatar
Midhun M M
Jawaban Terbai

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
Avatar
Buang
Kacper Kucharski
Penulis

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.

Avatar
Jaideep
Jawaban Terbai

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
Avatar
Buang
Kacper Kucharski
Penulis

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.

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Reabastecimiento de almacenes que no compran
inventory resupply v15
Avatar
0
Jun 23
2763
Allocate a quantity of stock for my sellers Diselesaikan
stock inventory v15
Avatar
Avatar
2
Des 21
3559
Issue with quantity available - Odoo 15
stock inventory stock_picking v15
Avatar
Avatar
Avatar
2
Jun 23
3592
Inventory adjustment Diselesaikan
stock inventory adjustment v15
Avatar
Avatar
2
Agu 24
3587
How to solve this error Field `show_check_availability` does not exist ?
stock inventory
Avatar
0
Jul 24
2858
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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