server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[ADD] new module base_selection

Open hailangvn opened this issue 2 years ago • 3 comments

Native Odoo field Selection does not allow removing items. This module provides a base model and an abstract model to support CRUD when working with selection items.

It is not useful by itself. You can see an example of implementation in the 'report_product_label' module. (stock-logistics-workflow repository).

Result

image image image

hailangvn avatar Jan 03 '23 01:01 hailangvn

Général question : did you tried to implement some new field argument "selection_remove" (like selection_add) ?

legalsylvain avatar Jan 03 '23 03:01 legalsylvain

Général question : did you tried to implement some new field argument "selection_remove" (like selection_add) ?

Thanks for your suggestions. They are applied. About the general question, looking at the sample implementation, I believe the update or delete will be taken care by ondelete of Many2one field. After adding new option to the list, it appears on UI without any coding. image image

Similarly, remove an option (i.e. 4 x 7) from the list, it disappears as well. Archiving and unarchiving options make them updated in UI. image image

hailangvn avatar Jan 04 '23 08:01 hailangvn

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Nov 02 '25 12:11 github-actions[bot]