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

Reverse Transfer - how to stop returning more than was delivered - Odoo.sh v16

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
returnsodoo
1 Odpowiedz
3687 Widoki
Awatar
Roy Antunovich

How do I stop a reverse transfer from being done for more than the delivered quantity on the Sales Order? At the moment my team can change the quantity on the Reverse Transfer to more than was delivered, this then leave the sales order with a negative delivered quantity.

I have a simple Automated action that stops delivering more product than is ordered. This is run on the Stock Move model, matching all records, and executes the python code.

if record.product_uom_qty

  raise UserError("You can't transfer more than the Initial Demand!")


I can't work out how to write this for a Reverse Transfer (Return Picking model) where the quantity gets compared to the delivered quantity on the sales order.

Any help would be appreciated.

0
Awatar
Odrzuć
Luis Jacobo

We are in the same page mate, can you share the server action for avoid delivering more product than is ordered?

Thanks.

Awatar
Gracious Joseph
Najlepsza odpowiedź

To stop a reverse transfer in Odoo 16 from being done for more than the delivered quantity, you can implement an automated action or override the relevant Odoo method to enforce this restriction.

Here’s how you can implement this:

1. Understanding the Requirement

  • Reverse Transfer: This process is initiated from the original delivery picking to return goods.
  • Delivered Quantity: You need to ensure that the return quantity does not exceed the delivered quantity.

2. Automated Action Approach

You can create an Automated Action that validates the return picking quantity before confirmation.

Steps to Create Automated Action

  1. Activate Developer Mode:
    • Go to Settings > Activate Developer Mode.
  2. Navigate to Automated Actions:
    • Go to Settings > Technical > Automated Actions.
  3. Create a New Automated Action:
    • Model: stock.move
    • Trigger: On Creation & Update
    • Condition: Add a domain to target only reverse transfers:
      [('picking_type_id.code', '=', 'incoming'), ('origin_returned_move_id', '!=', False)]
      
    • Python Code:
      for record in records:
          if record.origin_returned_move_id:
              delivered_qty = record.origin_returned_move_id.quantity_done
              if record.quantity_done > delivered_qty:
                  raise UserError(
                      "You cannot return more than the delivered quantity! Delivered: %s, Trying to Return: %s" %
                      (delivered_qty, record.quantity_done)
                  )
      

3. Server-Side Method Override (Recommended)

If your team is familiar with Odoo development, overriding the button_validate method on the stock.picking model ensures this logic is enforced at the server level.

Steps to Implement

  1. Create a Custom Module: If you don’t have one already, create a custom module.
  2. Extend the stock.picking Model: Override the button_validate method to add validation for reverse transfers.
    Code Example:
    from odoo import models, api
    from odoo.exceptions import UserError
    
    class StockPicking(models.Model):
        _inherit = 'stock.picking'
    
        @api.model
        def button_validate(self):
            for move in self.move_ids_without_package:
                if move.origin_returned_move_id:
                    delivered_qty = move.origin_returned_move_id.quantity_done
                    if move.quantity_done > delivered_qty:
                        raise UserError(
                            "You cannot return more than the delivered quantity! Delivered: %s, Trying to Return: %s" %
                            (delivered_qty, move.quantity_done)
                        )
            return super(StockPicking, self).button_validate()
    
  3. Restart the Server and Upgrade the Module:
    • Restart the Odoo server.
    • Upgrade the module.
    ./odoo-bin -u your_custom_module_name
    

4. Testing

  • Create a sales order and confirm delivery.
  • Initiate a reverse transfer.
  • Try to input a return quantity greater than the delivered quantity.
  • The system should block the operation and raise an appropriate error message.

5. Additional Considerations

  • Multi-Line Validation: If reverse transfers have multiple lines, ensure the logic applies to all lines.
  • Negative Quantities: Check if your setup allows negative stock, as this can also affect the validation.
  • Customizable Messaging: You can improve user feedback by including the product name or other relevant details in the error message.

6. Advantages of the Method

  • Automated Action: Quick to implement with minimal technical involvement.
  • Server-Side Method: More robust and ensures the rule is enforced even if users bypass the UI (e.g., through API).

By implementing one of these approaches, you can effectively prevent your team from returning more items than were delivered, maintaining accurate stock and sales order records. Let me know if you need further clarification or help!

0
Awatar
Odrzuć
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ść
Not returning list view Rozwiązane
returns odoo odoo12
Awatar
Awatar
Awatar
4
lip 19
4736
邮箱无法正常使用
odoo
Awatar
Awatar
1
lis 25
2223
SOC 1 Report
odoo
Awatar
0
lis 25
145
How do I go about this error? I am trying to uninstall a module
odoo
Awatar
Awatar
1
lis 25
3442
How to import product variants with my own external id when using dynamic creation mode Rozwiązane
odoo
Awatar
Awatar
2
sie 25
4008
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