コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
199 ビュー

For a business that delivers Water Bottles to customers once a week, is it possible to have sales orders be created automatically each week. Is there a way of doing this without using the subscriptions app?

アバター
破棄
最善の回答

Hi,


It’s possible to automate weekly sales orders in Odoo without using the Subscriptions app, though subscriptions are the standard approach. You can achieve this using automated actions or scheduled server actions.


Option 1: Scheduled Server Action


    Create a server action that generates a sales order for each customer.


        Go to Settings → Technical → Automation → Scheduled Actions.


        Create a new action:


            Model: sale.order


            Action To Do: Execute Python code


            Frequency: Weekly

    Python code example:


             customers = env['res.partner'].search([('is_water_customer','=',True)])

product = env['product.product'].search([('name','=','Water Bottle')], limit=1)


for customer in customers:

    order_vals = {

        'partner_id': customer.id,

        'order_line': [(0,0,{

            'product_id': product.id,

            'product_uom_qty': 5,  # Quantity per week

            'price_unit': product.list_price,

        })],

    }

    env['sale.order'].create(order_vals)


    is_water_customer can be a custom field on the customer to identify who receives weekly bottles.


    Adjust quantity, product, and pricing as needed.


    Activate the scheduled action to run every week on the desired day.


Option 2: Custom Module


    For more complex logic (e.g., different products for different customers, variable quantities), you can create a small custom module that automates weekly sales orders.


    The module can be configured to run via cron or scheduled action.


You do not need the Subscriptions app. By using scheduled server actions, you can automatically generate weekly sales orders for a list of customers. This can be simple Python code referencing a product and quantity, or a template-based system for more flexibility.


Hope it helps



アバター
破棄
最善の回答

Since it is about delivery schedule you could create a blanket SO and split the delivery order. (Or add new delivery orders to SO)

With the invoicing policy set to delivered qty period invoices can be generated only for the qty delivered.

アバター
破棄
最善の回答

Hello Mahmood,

You can manage it via schedule action with some technical setup i.e. Generate the sales orders with the correct products and quantities.
Subscription App:  Odoo has this built-in feature where you can define a recurring product or service.

アバター
破棄
関連投稿 返信 ビュー 活動
2
10月 25
165
0
10月 25
8
0
10月 25
141
0
10月 25
211
0
10月 25
3