Skip to Content
Menú
This question has been flagged

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
Related Posts Respostes Vistes Activitat
1
de maig 25
891
2
de nov. 24
2104
1
de set. 24
1164
4
de febr. 24
12248
1
de gen. 24
1608