Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Automating Product Sorting in Quotation Orders - Odoo 16 Module Development

Odebírat

Get notified when there's activity on this post

This question has been flagged
salessale.order.linequotationsale.orderrecordset
1 Odpovědět
3288 Zobrazení
Avatar
Ovidio Giolsot

Hi everyone,

I'm currently working on an Odoo 16 module to enhance the sorting functionality in quotation orders for the company I'm working with. Our quotation template has distinct sections for 'Devices' and 'Additional Fees.' The goal is to automatically place products in the appropriate sections when operators add them to the quotation. For example, adding a device should automatically position it under the 'Devices' section, while adding an extra fee like a shipment fee should be placed in the 'Additional Fees' section.

By default, Odoo places all products as the last item. As I'm relatively new to Odoo development, I need help understanding the best approach to implement this logic.

After some debugging, I looked into the 'call_kw/sale.order.line/read' API that is called after a product is added with the "Add multiple products" button, which returns the 'SaleOrderLine' RecordSet. My understanding is that I can modify this RecordSet using custom logic.

Here are my specific questions:

  1. How can I effectively modify the 'SaleOrderLine' RecordSet to automatically sort products into the respective sections?
  2. Are there alternative approaches that could be more efficient or better suited to achieve the automated sorting of products?

If anyone could provide me with code examples or point me in the right direction, I'd greatly appreciate your help and insights.

Thank you all in advance!


0
Avatar
Zrušit
Axel Mendoza

I think it's not a matter of sorting. For me it's a matter of having proper data. I haven't fully get the picture from your description of what you are trying to accomplish

Ovidio Giolsot
Autor

Hi Axel, I'm going to try to be clearer. Here's a step-by-step explanation:
1. Let's say the operator needs to create a new quotation.
2. To begin, the operator opens the quotation template provided by the company, which contains 4 lines. The first line is a section labeled 'Devices,' the second line contains the actual device products, the third line is a section labeled 'additional fees,' and the fourth line is for the shipment fee product.
3. Assuming the operator adds a device to the quotation, the device doesn't get positioned in the 'Devices' section but instead ends up as the last line of the quotation. Visually, it appears within the 'additional fees' section.
In the example I provided, the device should be placed at line 3, before the 'Additional fees' section. To distinguish the products from the additional fees, I can use a regex since the devices have similar names. So, that's not a big deal.

Jason Vu

Hi Ovidio, maybe you're complicating matters, just add first section then all products of this section then continue with other sections

Avatar
Jason Vu
Nejlepší odpověď

Hi,

You can add to your form tree this attribute: default_order="product_id asc"

or just want to sort in report only:

t-set="lines" t-value="line_ids.sorted(lambda l: l.product_id)" ​

Regards!

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How can I add a product to a Sales Order with its Barcode? Vyřešeno
sales barcode sale.order.line sale.order
Avatar
Avatar
Avatar
Avatar
3
čvc 24
14752
How to get product quantity in particular warehouse in sales order Odoo 9 ?
sales sale.order.line sale.order odoo-v9
Avatar
Avatar
Avatar
Avatar
3
bře 18
6522
How to limit the sale of a specific product in odoo 15
sales sale.order.line sale.order v15 ventas
Avatar
Avatar
1
led 23
4228
sale.order add state to quotation workflow
sales state quotation sale.order adding
Avatar
0
dub 19
6679
Warehouse is not changing in Quotation
sales warehouses inventory quotation sale.order
Avatar
Avatar
3
čvc 18
4487
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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