跳至內容
選單
此問題已被標幟
2 回覆
2654 瀏覽次數

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 () {
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 25
529
0
1月 21
2461
4
9月 16
5269
1
5月 16
3735
0
5月 25
840