Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Real Estate
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

Automating Product Sorting in Quotation Orders - Odoo 16 Module Development

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
salessale.order.linequotationsale.orderrecordset
1 Відповісти
3150 Переглядів
Аватар
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
Аватар
Відмінити
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
Автор

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

Аватар
Jason Vu
Найкраща відповідь

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
Аватар
Відмінити
Enjoying the discussion? Don't just read, join in!

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

Реєстрація
Related Posts Відповіді Переглядів Дія
How can I add a product to a Sales Order with its Barcode? Вирішено
sales barcode sale.order.line sale.order
Аватар
Аватар
Аватар
Аватар
3
лип. 24
14552
How to get product quantity in particular warehouse in sales order Odoo 9 ?
sales sale.order.line sale.order odoo-v9
Аватар
Аватар
Аватар
Аватар
3
бер. 18
6446
How to limit the sale of a specific product in odoo 15
sales sale.order.line sale.order v15 ventas
Аватар
Аватар
1
січ. 23
4099
sale.order add state to quotation workflow
sales state quotation sale.order adding
Аватар
0
квіт. 19
6460
Warehouse is not changing in Quotation
sales warehouses inventory quotation sale.order
Аватар
Аватар
3
лип. 18
4398
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція 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