Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Automating Product Sorting in Quotation Orders - Odoo 16 Module Development

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
salessale.order.linequotationsale.orderrecordset
1 Răspunde
3210 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
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

Imagine profil
Jason Vu
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
How can I add a product to a Sales Order with its Barcode? Rezolvat
sales barcode sale.order.line sale.order
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
iul. 24
14649
How to get product quantity in particular warehouse in sales order Odoo 9 ?
sales sale.order.line sale.order odoo-v9
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
mar. 18
6470
How to limit the sale of a specific product in odoo 15
sales sale.order.line sale.order v15 ventas
Imagine profil
Imagine profil
1
ian. 23
4172
sale.order add state to quotation workflow
sales state quotation sale.order adding
Imagine profil
0
apr. 19
6610
Warehouse is not changing in Quotation
sales warehouses inventory quotation sale.order
Imagine profil
Imagine profil
3
iul. 18
4462
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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