Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2701 Переглядів

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?

Аватар
Відмінити
Автор

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 () {

Найкраща відповідь

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.

Аватар
Відмінити
Автор Найкраща відповідь
var fields = require('web.basic_fields');
var _formatValue = require('web.AbstractField').prototype._formatValue;

var ParenthesesField = fields.FieldMonetary.extend({
    className: 'o_field_parentheses',
    
    _renderReadonly: function () {
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
лип. 25
632
0
січ. 21
2562
4
вер. 16
5340
1
трав. 16
3751
0
трав. 25
867