1

I'm trying to change field label/string on amount_by_group field that is showing total tax amount on Invoice form.

Tried to do it like this - using field attributes

<xpath expr="//field[@name='amount_by_group']" position="attributes">
    <attribute name="string">Porez</attribute>
</xpath>

No luck, also tried to replace field with the same field but with string defined

<xpath expr="//field[@name='amount_by_group']" position="replace">
    <field name="amount_by_group" widget="tax-group-custom-field" nolabel="1" colspan="2" attrs="{'invisible': [('amount_tax', '=', 0)]}" string="Tax"/>
</xpath>

I used methods described here (first two points in answer by Cybrosys) https://www.odoo.com/forum/help-1/change-field-label-through-python-149963

Does anybody have clue how to change that fields name? At the moment field label is "Neoporezivo" and I'd like to show it as "Porez".

1 Answers1

1

What you tried is correct. It seems in your case, you have to update field translation.

When we load a new language, Odoo translates terms based on .po file given the folder i18n in the related module.

You can try first from the front end and if it works, you can override .po file.

Try this:

  • Active developer mode.
  • Go to Settings > Translations > Translated Terms
  • Find your displayed term and edit it with your desired term.
  • Refresh your page and check your form. It should update with the desired term.

EDIT:

enter image description here

Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
  • Bhavesh, thank you for your answer. I tried to find translation but no luck, there are some strings named like that but aren't changing anything. I appreciate your help, It is defined somewhere else (can't find it in code) - I will mark your answer as correct but in my case there is something else happening. – Matija Amondi Sep 01 '22 at 07:46
  • Make sure you have necessary access rights of the setting. Also turn on developer mode (I know you already did that). I edit my answer with screen reference - Odoo 13 CE and menu location is same in EE. – Bhavesh Odedra Sep 01 '22 at 17:05