Saturday, February 18, 2023
1 change · master
New functionality added to Odoo
This change lets Odoo administrators and developers mark specific fields as unavailable in export dialogs. It helps reduce clutter and can prevent sensitive or low-value internal data, such as access tokens, from being exposed during exports.
Original PR description
Description of the issue/feature this PR addresses: Odoo has been growing and more and more technical fields have been added who either contain rather sensitive data or nothing useful for exporting.…
Description of the issue/feature this PR addresses: Odoo has been growing and more and more technical fields have been added who either contain rather sensitive data or nothing useful for exporting. See also the discussion at https://twitter.com/ggellatly/status/1524145898380738561
Current behavior before PR: Every single field in Odoo is by default shown in the export dialog causing an overload of info with quite often content shown that has no use (or should even be hidden for semi-security reasons).
Desired behavior after PR is merged:
By adding an attribute `exportable` on the `ir.model.fields` we can custom define which fields we want to be exportable or not.
For example: by default on the `sale.order` model the field `access_token` is by default exportable. If you'd flag the field as non-exportable it would no longer show up and thus not leak (rather sensitive) data:
```
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class SaleOrder(models.Model):
_inherit = 'sale.order'
access_token = fields.Char(
exportable=False
)
```
By adding this configurable flag a developer could override any field and simply add the `exportable` flag which is set to `False`.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr