跳至内容
菜单
此问题已终结
1 回复
435 查看

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


形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
1
5月 25
1012
1
5月 23
1619
3
1月 16
9649
0
9月 20
7546
0
3月 25
1721