Files
odoo_source/addons/web/static/src/views/fields/relational_utils.xml
T
Lucas Perais 00fff80858 [FIX] web: one2many in kanban can remove a new record
Have a one2many in a form view. It displays its records with a kanban.
Add a record, now click on that new record.

Before this commit, there was not "Remove" button, preventing to effectively
remove a new (virtual at this point) record from the one2many.

Aftet this commit, there is a remove button that effectively removes the
record from the one2many.

closes odoo/odoo#97775

Signed-off-by: FrancoisGe <fge@odoo.com>
2022-08-10 14:43:45 +02:00

62 lines
2.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="web.X2ManyFieldDialog" owl="1">
<Dialog title="title" contentClass="'o_form_view_dialog'" modalRef="modalRef">
<FormRenderer class="'o_form_view'" record="record" fields="archInfo.fields" archInfo="archInfo"/>
<t t-set-slot="footer">
<t t-if="footerArchInfo">
<FormRenderer record="record" archInfo="footerArchInfo"/>
</t>
<t t-else="">
<t t-if="record.isInEdition and !record.resId">
<button class="btn btn-primary o_form_button_save" t-on-click="save" data-hotkey="c">Save &amp; Close</button>
<button class="btn btn-primary o_form_button_save_new" t-on-click="saveAndNew" data-hotkey="n">Save &amp; New</button>
<button class="btn btn-secondary o_form_button_cancel" t-on-click="discard" data-hotkey="j">Discard</button>
<t t-if="props.delete">
<button class="btn btn-secondary o_btn_remove" t-on-click="remove" data-hotkey="k">Remove</button>
</t>
</t>
<t t-elif="record.isInEdition">
<button class="btn btn-primary o_form_button_save" t-on-click="save" data-hotkey="c">Save</button>
<button class="btn btn-secondary o_form_button_cancel" t-on-click="discard" data-hotkey="j">Discard</button>
<t t-if="props.delete">
<button class="btn btn-secondary o_btn_remove" t-on-click="remove" data-hotkey="k">Remove</button>
</t>
</t>
<t t-else="">
<button class="btn btn-primary o_form_button_cancel" t-on-click="() => this.props.close()" data-hotkey="j">Close</button>
</t>
</t>
</t>
</Dialog>
</t>
<t t-name="web.Many2XAutocomplete" owl="1" >
<div class="o_input_dropdown" t-ref="autocomplete_container">
<input t-if="env.isSmall"
type="text"
t-att-id="props.id"
class="o_input"
readonly=""
t-att-value="props.value"
t-on-click="onSearchMore"
/>
<AutoComplete t-else=""
value="props.value"
id="props.id"
placeholder="props.placeholder"
sources="sources"
autoSelect="props.autoSelect"
onSelect.bind="onSelect"
onInput.bind="onInput"
onChange.bind="onChange"
/>
<a role="button" class="o_dropdown_button" draggable="false" />
</div>
</t>
</templates>