Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Create credit notes from returns

Odoberať

Get notified when there's activity on this post

This question has been flagged
inventoryreturnscreditnotesAutomatedActionsOdooThinking!
3 Replies
7098 Zobrazenia
Avatar
Ricardo Gross

Is it possible to automatically create credit notes when confirming returns of goods using automated actions?

2
Avatar
Zrušiť
Avatar
CandidRoot Solutions Private Limited
Best Answer

Hello Ricardo Gross

Yes, it is possible to create credit notes while returning goods.

when we returns product, system create stock.picking record with value of Reference = "Return of WH/OUT/00016". so we can create automatic action on create new record of stock.picking model to check reference value if it is start with "Return" keyword then get sale_id (default field in stock.picking)

Now sale order do have invoice_ids fiels to get invoice and we can call "reverse_move" of those invoice to crate credit notes.

please check automated action with python code 


# check if action trigger for return order and related sale order has invoice created with payment
if
record.origin.startswith('Return of') and record.sale_id.invoice_ids.filtered(lambda move: move.state == 'posted'):
invoice_ids = record.sale_id.invoice_ids.filtered(lambda move: move.state == 'posted')
# create refund wizard
move_reversal = env['account.move.reversal'].with_context(active_model="account.move", active_ids=invoice_ids.ids).create({
'date': datetime.datetime.today().strftime('%Y-%m-%d'),
'reason': 'no reason',
'refund_method': 'refund',
'journal_id': invoice_ids.journal_id.id,})
# create revese move
move_reversal.reverse_moves()
# get last invoice as credit note
invoice_refund = record.sale_id.invoice_ids.sorted(key=lambda inv: inv.id, reverse=False)[-1]
# post credit note invoice_refund.action_post()

Result:



Thanks & Regards,

​

CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
     

4
Avatar
Zrušiť
Ricardo Gross
Autor

Thank you CandidRoot for your answer and the information provided, but trying to create the automated action, I must be making some mistake, could you please explain how to setup this, I am sure that other followers of this forum would also appreciate

CandidRoot Solutions Private Limited

Hello Ricardo Gross,
Based on your request i have provied automation action with python code.

please check my updated answer and mark as best answer if it is helpfull

NS

Thank you very much for detailed solution

Ricardo Gross
Autor

Thank you very much! there is still a small detail to correct, because in this way, the credit note is already being created before I confirm the return, and if I delivery 2 units and return only 1, the credit note should be only for 1, not 2 units

Avatar
Jose S. May
Best Answer

I usually solve the problem of automatically generating credit notes after a confirmed return using Automated Actions combined with a small Python script. The key is to make sure that the credit note is only generated after a confirmed return and only for orders that have been invoiced. If you have time, check out https://unblockedgamespremium.io for more details.

0
Avatar
Zrušiť
Avatar
Flavio Guzman
Best Answer

Gracias amigo, me funcionó para V17 pero tuve que eliminar #'refund_method': 'refund' ya que ese campo no está disponible en el modelo account.move.reversal

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to manage Inventory Valuation and Credit note journal entries when doing a return? Solved
accounting inventory returns quickstart creditnotes
Avatar
1
dec 24
7524
Apply one credit note to multiple invoices
returns creditnotes
Avatar
Avatar
1
aug 24
2734
Can we have non-sellable locations? Odoo v14e Solved
inventory returns
Avatar
Avatar
2
feb 23
5493
How to associate two transfers(OUT & IN) to a Sales Order
sales inventory returns
Avatar
Avatar
2
júl 18
5535
How to trigger (create) a delivery order for a rental order?
rental inventory deliveryorder AutomatedActions
Avatar
Avatar
Avatar
Avatar
3
okt 24
3310
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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