How to hide unused fields globally?

For a small single-company, single currency business, I want to hide unused field from all views. First of all these are “company” and “currency”.

Doing this via Administation→Model→Fields is cumbersome and error-prone. There are more than 200 fields just for for company anf currency.

How can this be done efficiently?

As both are relation fields you can remove the read access for your use on the company and currency models. This will hide the values on all the user interface but you will need to have an speciall user with access to thos model just in case you will need to update something of this models.

I’ve never tried this aproach but everything should work as both fields have a default value.
Feel free to try it at your own risk.

I’m not sure that will work?

If the user doesn’t have read access to the company or currency models then how will they be able read from those to find which values to use as the defaults for the company or currency?

Another way may be to add a custom module with a simple mixin that overrides fields_view_get and removes any fields from the view that are called company or currency or have a relation to or currency.currency.

You would also need a way to turn this behaviour on or off, possibly with a setting in the user preferences.

They won’t but the system will set the default values for them which are read the company from the context (and the currency from the company context). So as far as the right company value is set on the context it should work.

I think it is pointless to talk about such thing. There are many places where such rule will break the system.
This is something Tryton does not support and will not.

If the user does not touch these fields, these get filled with defaults, right? (Of course, the admin needs set the defaults and needs to be able to change them if need arises.)
So in the WebUI, I could simply add some CSS to hide these fields. And since there are defaults, this should work, shouldn’t it?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.