def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None):
     """ Inherited - add amount_in_word and allow_check_writing in returned value dictionary """
     if not context:
         context = {}
     default = super(account_voucher, self).onchange_amount(cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=context)
     if 'value' in default:
         amount = 'amount' in default['value'] and default['value']['amount'] or amount
         amount_in_word = amount_to_text(amount)
         default['value'].update({'amount_in_word':amount_in_word})
         if journal_id:
             allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing
             default['value'].update({'allow_check':allow_check_writing})
     return default
Beispiel #2
0
 def onchange_amount(self,
                     cr,
                     uid,
                     ids,
                     amount,
                     rate,
                     partner_id,
                     journal_id,
                     currency_id,
                     ttype,
                     date,
                     payment_rate_currency_id,
                     company_id,
                     context=None):
     """ Inherited - add amount_in_word and allow_check_writing in returned value dictionary """
     if not context:
         context = {}
     default = super(account_voucher,
                     self).onchange_amount(cr,
                                           uid,
                                           ids,
                                           amount,
                                           rate,
                                           partner_id,
                                           journal_id,
                                           currency_id,
                                           ttype,
                                           date,
                                           payment_rate_currency_id,
                                           company_id,
                                           context=context)
     if 'value' in default:
         amount = 'amount' in default['value'] and default['value'][
             'amount'] or amount
         amount_in_word = amount_to_text(amount)
         default['value'].update({'amount_in_word': amount_in_word})
         if journal_id:
             allow_check_writing = self.pool.get('account.journal').browse(
                 cr, uid, journal_id, context=context).allow_check_writing
             default['value'].update({'allow_check': allow_check_writing})
     return default
Beispiel #3
0
 def _get_amount_in_word(self, cr, uid, ids, field_name, arg, context=None):
     res = {}
     for check in self.browse(cr, uid, ids, context=context):
         res.update({check.id: amount_to_text(check.amount)})
     return res
 def _get_amount_in_word(self, cr, uid, ids, field_name, arg, context=None):
     res = {}
     for check in self.browse(cr, uid, ids, context=context):
         res.update({check.id: amount_to_text(check.amount)})
     return res