Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
2608 Tampilan

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?

Avatar
Buang
Penulis

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

Jawaban Terbai

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.

Avatar
Buang
Penulis Jawaban Terbai
var fields = require('web.basic_fields');
var _formatValue = require('web.AbstractField').prototype._formatValue;

var ParenthesesField = fields.FieldMonetary.extend({
    className: 'o_field_parentheses',
    
    _renderReadonly: function () {
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Jul 25
441
0
Jan 21
2355
4
Sep 16
5204
1
Mei 16
3710
0
Mei 25
791