Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
2655 Представления

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
535
0
янв. 21
2463
4
сент. 16
5270
1
мая 16
3735
0
мая 25
841