Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6324 มุมมอง


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

digits :

'exchange_rate': fields.related('currency_id', 'rate', type='float', string='Exchange Rate', digits=(12,6)),


or digits_compute defined value :

xml

<record forcecreate="True" id="decimal_account" model="decimal.precision">

     <field name="name">Account</field>

     <field name="digits">2</field>

</record>

python

import openerp.addons.decimal_precision as dp

'credit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Credit', multi='balance'),


or digits_compute function :

from openerp import SUPERUSER_ID

import openerp

def get_precision_tax():

     def change_digit_tax(cr):

         res = openerp.registry(cr.dbname)['decimal.precision'].precision_get(cr, SUPERUSER_ID, 'Account')

         return (16, res+3)

return change_digit_tax


'amount': fields.float('Amount', required=True, digits_compute=get_precision_tax(), help="For Tax Type percent enter % ratio between 0-1."),

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 22
7993
1
เม.ย. 16
4471
1
มิ.ย. 15
4342
1
มิ.ย. 15
3229
0
มี.ค. 15
3453