I want to create a sale.order from the event.booth.form via a button like this:
https://shottr.cc/s/GHmR/SCR-20220908-lxrp.png
When i click on the button I want a form to pop up, where i can select the partner and then it should create a sale.order with the booth selected as the product.
I'm not sure, how to do this, but this is my attempt:
record id="event_booth_registration_action" model="ir.actions.act_window">
<field name="name">Select an event boothfield>
<field name="res_model">event.booth.registrationfield>
<field name="view_mode">formfield>
<field name="target">newfield>
I am trying to open the form for the event_booth_registration
This is what the form I created looks like:
<record id="event_booth_registration_view_form" model="ir.ui.view">
<field name="name">event.booth.registration.view.formfield>
<field name="model">event.booth.registrationfield>
<field name="arch" type="xml">
<form>
<group>
<group>
<field name="partner_id" readonly="1"/>
<field name="event_booth_id" readonly="1"/>
group>
<group>
<field name="event_booth_registration_ids" options="{'no_create': True, 'no_open': True}" widget="many2many_checkboxes" domain="[('event_id', '=', event_id), ('event_booth_id.halle_id', '=', halle_id)]"/>
<field name="plan" widget="image"/>
group>
group>
<footer>
<button string="Fertig" class="btn-primary" special="save"/>
<button string="Abbrechen" class="btn-secondary" special="cancel"/>
footer>
form>
field>
record>
I added the "done" and "cancel" button, but i'm not sure how to create a sale order that has the booth as product when the user clicks "fertig" a.k.a. "done"
I have looked at other code and it seems like a js_class in the
tag might help me, however i do not know, how that works or what to do itWhat is the best way to achieve this?
Thank you for your help.
