تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    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:

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

Implementing Warehouse Logic with Automated Actions and Python Code in Odoo

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
warehousesAutomatedActionsdeliveries-warehouseodoo16featuresPythonCode
2361 أدوات العرض
الصورة الرمزية
Skander Ghamgui

Hello Odoo Community,


I'm currently working on optimizing my delivery and picking processes in Odoo, and I'm seeking guidance on implementing a specific logic using Automated Actions and Python code.


Objective:

When a customer places an order, I want Odoo to intelligently determine from which warehouse the order should be picked based on the availability of the products in different warehouses.


Logic Overview:

I've already devised a Python function that efficiently distributes the order quantity among different warehouses based on their availability. Here's a simplified version of the logic:


def fulfill_order(main_qty, C_qty, B_qty, A_qty, order_qty):
    def find_most_products(warehouses):
        # Prioritize C > B > A
        warehouse_order = [C_qty, B_qty, A_qty]
        max_index = max(range(len(warehouses)), key=lambda i: (warehouses[i], -warehouse_order[i]))
        return max_index

    total_available_qty = main_qty + C_qty + B_qty + A_qty

    print(f"Order Quantity: {order_qty}")
    print("Initial product availability:")
    print(f"- Main Warehouse: {main_qty}")
    print(f"- Warehouse C: {C_qty}")
    print(f"- Warehouse B: {B_qty}")
    print(f"- Warehouse A: {A_qty}\n")

    main_taken = min(main_qty, order_qty)
    main_qty -= main_taken
    order_qty -= main_taken

    def distribute_from_warehouses(qty, warehouses):
        distributed = [0, 0, 0]
        for _ in range(qty):
            if sum(warehouses) == 0:
                break
            most_products_index = find_most_products(warehouses)
            distributed[most_products_index] += 1
            warehouses[most_products_index] -= 1

        return distributed

    distributed_qty = distribute_from_warehouses(order_qty, [C_qty, B_qty, A_qty])

    C_qty -= distributed_qty[0]
    B_qty -= distributed_qty[1]
    A_qty -= distributed_qty[2]

    print("Products distributed:")
    if main_taken > 0:
        print(f"- {main_taken} products from Main Warehouse")
    if distributed_qty[0] > 0:
        print(f"- {distributed_qty[0]} products from Warehouse C")
    if distributed_qty[1] > 0:
        print(f"- {distributed_qty[1]} products from Warehouse B")
    if distributed_qty[2] > 0:
        print(f"- {distributed_qty[2]} products from Warehouse A")

    print(f"\nRemaining product availability:")
    print(f"- Main Warehouse: {main_qty}")
    print(f"- Warehouse C: {C_qty}")
    print(f"- Warehouse B: {B_qty}")
    print(f"- Warehouse A: {A_qty}")

    remaining_qty = order_qty - sum(distributed_qty)
    if remaining_qty > 0:
        print(f"\n{remaining_qty} products are not available")

# Example usage
main_qty = int(input("How many products are available in Main Warehouse? "))
C_qty = int(input("How many products are available in Warehouse C? "))
B_qty = int(input("How many products are available in Warehouse B? "))
A_qty = int(input("How many products are available in Warehouse A? "))
order_qty = int(input("How many products did the customer order? "))

fulfill_order(main_qty, C_qty, B_qty, A_qty, order_qty)


Scenario: I have multiple warehouses where A, B, and C also function as points of sale with a depot inside, while the main warehouse is solely for storage and not a point of sale.

Question: How can I integrate this Python logic into Odoo using Automated Actions? Specifically, I want Odoo to automatically execute this Python function whenever a new order is placed, so the system can determine the optimal warehouse for picking.

Additional Notes:

  • I understand that Automated Actions allow for triggering actions based on specific events in Odoo.
  • I'm not entirely sure about the process of executing custom Python code within an Automated Action in Odoo.
  • Any insights, examples, or pointers on how to achieve this integration would be greatly appreciated.
  • You can copy paste the code and try it for your self with different scenarios so you can better understand the logic I want to impliment
  • You can ask me any questions for more clarifications I'll answer as soon as I can
  • Any help is greatly appreciated

Thank you in advance for your assistance!

Best regards,

Skander

1
الصورة الرمزية
إهمال
Ricardo Gross

very good question! did you find the solution "to intelligently determine from which warehouse the order should be picked based on the availability of the products in different warehouses"?

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Odoo16: where is Automated Actions in Technical menu تم الحل
AutomatedActions odoo16features
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
أكتوبر 23
4410
ValueError: <class 'psycopg2.ProgrammingError'>: "can't adapt type 'mail.activity.type'" تم الحل
activity AutomatedActions odoo16features
الصورة الرمزية
1
أغسطس 23
3762
ValueError: [class 'psycopg2.ProgrammingError']: "can't adapt type 'ir.model'" while evaluating تم الحل
activity AutomatedActions odoo16features
الصورة الرمزية
الصورة الرمزية
1
أغسطس 23
4548
Automated Action to clone a task and adding days to due date تم الحل
project.task AutomatedActions odoo16features
الصورة الرمزية
1
نوفمبر 22
3671
default value of fied based on another field odoo16
sales warehouses product odoo16features
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
يوليو 25
5212
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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