Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
4 Vastaukset
5319 Näkymät

How to hide "Remove" button in view dialogs when we open one2many record in form view.

***Many times users deleted the record by mistake

Reference:

https://github.com/odoo/odoo/blob/1ca707ef6e83dd9a1708534f3732cefbaefac6fd/addons/web/static/src/js/views/view_dialogs.js#L155

Note: I tried delete="false" in one2many form tag


Avatar
Hylkää

Hi,

What about setting an exception(User Error) while deleting the record

You can add that exception by super the function def unlink(self)

Regards

Tekijä

def unlink(self) will be called once the record is saved but it will not work if the line is not saved.

Ex:

Vendor invoice line which is filled by onchange of PO.

If I open a vendor invoice line before saving the invoice form and it wont call a unlink function if I click remove button.

Is there any feature available like delete="false"

I tried but I don't see Remove in the popup of o2m field.

Tekijä

Hi Sudhir Note Version: 12.0.post20190904

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
kesäk. 22
2228
1
maalisk. 15
3807
2
heinäk. 25
6551
2
tammik. 24
1464
0
marrask. 23
1344