web icon indicating copy to clipboard operation
web copied to clipboard

[16.0][IMP] web_timeline: implementing readonly_field attribute: a boolean field to mark the event as not editable

Open IJOL opened this issue 1 year ago • 13 comments

Marks events as non editable following a field in the model

IJOL avatar Nov 07 '24 12:11 IJOL

Hi @tarteo, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Nov 07 '24 12:11 OCA-git-bot

@carlos-lopez-tecnativa and this one too, thanks in advance

IJOL avatar Nov 07 '24 12:11 IJOL

You are right i see the same, open a blank form, looking into this RN, the use you propose of the new attribute is perfectly valid, and that is the intended use case be able to put readonly bars in the timeline, i will see if can solve, at least not present a blank form, can you think of a way to show a readonly view of the form? if not the only solution now is to not show the popup

IJOL avatar Nov 07 '24 15:11 IJOL

Btw nice use of the timeline... i will add it to my rather long todo list

IJOL avatar Nov 07 '24 15:11 IJOL

@IJOL I believe these changes are covered in this PR. You can add edit="0", or expand it to support expressions if needed. https://github.com/OCA/web/pull/2791

carlos-lopez-tecnativa avatar Nov 07 '24 16:11 carlos-lopez-tecnativa

The issue is that you can control only group change ( lane change ) without forbid editing, i need to control group but not the data itself, and thats is because i use synthetic non relational groups in my use case where is appropiate to edit the event linked but not to change the group, makes only the group readonly essentially

IJOL avatar Nov 07 '24 16:11 IJOL

And my use case is related to listing rentals where the group is the name of the product, you can change the dates but not the product in the line, and for those use cases I need too the readonly_field attribute, because i need lines in confirmed sale orders to be readonly..

IJOL avatar Nov 07 '24 16:11 IJOL

The blank form is correct, is an add operation, that can be controlled with the create attribute, so my change is not the culprit is simply working correctly :)

IJOL avatar Nov 07 '24 16:11 IJOL

Shouldn't that be done with a special attribute like in kanban for not allowing drag and drop between groups? And for the form part, define a special form view to view used when opening the record, with the readonly fields you need. On one2many widget, that can be done passing through context tree_view_ref or form_view_ref.

pedrobaeza avatar Nov 07 '24 16:11 pedrobaeza

Shouldn't that be done with a special attribute like in kanban for not allowing drag and drop between groups? And for

this is exactly what i'm proposing a new attribute "edit_group" to control exactly this, i'm open to any name change that fits better

IJOL avatar Nov 07 '24 16:11 IJOL

this last comment was wrong, the pr where i propose the edit_group is another, sorry bout that

IJOL avatar Nov 07 '24 16:11 IJOL

Check how it's called in kanban, and you can use the same for homogeneity.

pedrobaeza avatar Nov 07 '24 16:11 pedrobaeza

We are talking here of https://github.com/OCA/web/pull/2980, I had selected the opposite naming :100: for me, i will change it to fit, good catch..

IJOL avatar Nov 07 '24 16:11 IJOL