Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
2681 Vizualizări

Hi
The accountant asks us for a feature in the currency settings (res.currency) Be enabled by activating an option Changed currency display
For example, put negative values ​​in parentheses ()
-100=>(-100)
Or if the value was zero Dash - Display

 Has anyone had experience doing this?

Imagine profil
Abandonează
Autor

If I inherit from the FieldMonetary
And override function
"_renderReadonly"
There is still a problem
Only fields that have "widget = monetary"
They will have this feature

var fields = require('web.basic_fields');
var _formatValue = require('web.AbstractField').prototype._formatValue;

var ParenthesesField = fields.FieldMonetary.extend({
className: 'o_field_parentheses',

_renderReadonly: function () {

Cel mai bun răspuns

no experience. I don't know technically if currency is the appropriate object for this customization, but maybe you should check the Translation settings as well to find the right object for the customization.

Imagine profil
Abandonează
Autor Cel mai bun răspuns
var fields = require('web.basic_fields');
var _formatValue = require('web.AbstractField').prototype._formatValue;

var ParenthesesField = fields.FieldMonetary.extend({
    className: 'o_field_parentheses',
    
    _renderReadonly: function () {
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iul. 25
564
0
ian. 21
2488
4
sept. 16
5289
1
mai 16
3740
0
mai 25
848