I'm showing a related model by using the
related_model_ids
field in the model form view
The link for adding a record in the related model is
"Add a line" (in the attached image it's "Aggiungi riga", that's the transaltion in Italian)
What's the idiomatic odooish way to change that string ?
Is it by overriding the default_view_get
method ?
Depends on what you want to achieve.
Change the string for that one case
You can add controls to your tree view and decide what strings will be used. Link to the official doc
For example:
Change the string for all default cases
Changing the default string can probably be made by overriding the translation "Add a line" (web module: #: code:addons/web/static/src/js/views/list/list_editable_renderer.js:0) or by extending/changing that part on the list_renderer's JavaScript code which can be found here for Odoo 14.
Edit for atleast Odoo 14: Seems that the controls only work with extra widgets, for example the widget
section_and_note_one2many
. So you have to change thefield
node by adding the widget. Then you can use the controls.