Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
337 Visualizações

I changed the symbol position to "After amount" and changed the Symbol to €test just to make sure that its exactly this record, and it is, but the currency field is still displayed before the amount.


currency_id = fields.Many2one(

"res.currency", default=lambda self: self.env.company.currency_id, readonly=True

)


lohnkosten_m = fields.Monetary(

currency_field="currency_id"

)

view:

<group>

<field name="currency_id" invisible="1"/>

<field name="lohnkosten_m" widget="monetary" options="{'currency_field': 'currency_id'}" />

</group>


Odoo v17


Avatar
Cancelar
Melhor resposta

Hi,


Odoo determines where to place the currency symbol based on the settings of the currency itself and the user’s language. The symbol and position fields on the currency record define how the symbol should appear, but the user’s locale can override this. For example, in German, the Euro symbol is often shown before the amount regardless of the currency record’s settings.

If you changed the currency record to place the symbol after the amount but still see it before, it’s likely due to language formatting or cached assets in the browser. A hard refresh or clearing the cache can sometimes solve this, but often the issue comes from the language’s monetary format, which dictates how numbers and symbols are displayed.

There are two main ways to fix this. The cleanest way is to adjust the language configuration in Settings → Translations → Languages. Editing the monetary format field (for example, changing it to #,##0.00 ¤) ensures the symbol always displays after the amount. Alternatively, if you want full control and don’t want to rely on language settings, you can override the monetary widget in QWeb to explicitly render the amount followed by the currency symbol. This forces the display format regardless of locale.


Hope it helps

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
set. 25
14
1
mai. 25
991
1
mai. 23
1583
3
jan. 16
9595
0
set. 20
7490