Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
237 Weergaven

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?

Avatar
Annuleer
Beste antwoord

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



Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
okt. 25
96
3
okt. 25
238
0
okt. 25
8
0
okt. 25
159
0
okt. 25
223