2016-01-14 57 views

回答

0

你需要重寫default_get該對象的方法。

def default_get(self, cr, uid, fields, context=None): 
    if context is None: 
     context = {} 
    res = super(hr_expense_expense, self).default_get(cr, uid, fields, context=context) 

    #here is your logic 
    opening_balance = 111 #do calculation as per your requirements 

    #update opening balance field 
    res.update({'openning_balance_field_name': opening_balance}) 

    return res 
+0

沒有必要計算opening_balance.Opening餘額應該自動填充以前closing_balance當值員工創建下一個記錄時的值。 –