Ir al contenido
Menú
Se marcó esta pregunta

Hi,


I think there are some addons that can add booking feature but I want to implement it myself.


I am new to Odoo and I am trying to simulate a Booking feature in the Odoo webshop where customers can book a product, get a booking confirmation that they can print and use to collect the product in person from the store.


My products have a zero price so when a customer add them to the shopping cart and proceed to checkout then a quotation is created. This draft quotation does not update the webshop stock value which is a problem. The stock values is only updated when the quotation is manually confirmed to a sale order.


I used the following method to update the webshop stock. I used "Automated Actions" on a Sale order and a python script to auto confirm the draft quotation. The webshop stock is indeed updated but as a side effect the customer no longer gets the order confirmation page after confirming the shopping cart.


# My python script in Sale order automated action

for rec in records:

  if rec.user_id.id == odooBotUserId and not rec.partner_id.id == publicUserPartnerId and rec.state == "draft" and rec.team_id.id == websiteTeamId and rec.amount_total <= 0:

   rec.action_confirm()


Any suggestions or ideas on how to implement this booking feature in a better way?

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
may 25
895
2
nov 24
2110
1
sept 24
1169
4
feb 24
12252
1
ene 24
1620