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

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 25
904
2
nov. 24
2136
1
sep. 24
1180
4
feb. 24
12262
1
jan. 24
1636