~ubuntu-branches/debian/squeeze/openerp-server/squeeze

« back to all changes in this revision

Viewing changes to bin/addons/account/account.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-24 20:16:55 UTC
  • mfrom: (8.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090824201655-vxt26g90x7geu29t
* Merging upstream version 5.0.3-0.
* Removing xmlrpc.patch, went upstream.
* Using dedicated storage directory in /var/lib/openerp-server, that
  way the addons directory can stay read-only for the unprivileged
  user.
* Commenting out db_name in config (Closes: #542391).
* Commenting out port in config (Closes: #542406).
* Renaming logfile to openerp-server.log for consistency.
* Commenting out pidfile in config (Closes: #542427).
* Removing debconf handling in postrm, not possible to do that.
* Removing local storage directory on purge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
652
652
        'name': fields.char('Journal-Period Name', size=64, required=True),
653
653
        'journal_id': fields.many2one('account.journal', 'Journal', required=True, ondelete="cascade"),
654
654
        'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"),
655
 
        'icon': fields.function(_icon_get, method=True, string='Icon', type='string'),
 
655
        'icon': fields.function(_icon_get, method=True, string='Icon', type='char', size=32),
656
656
        'active': fields.boolean('Active', required=True),
657
657
        'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'Status', required=True, readonly=True),
658
658
        'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
2205
2205
            #create the account_account for this bank journal
2206
2206
            tmp = self.pool.get('res.partner.bank').name_get(cr, uid, [line.acc_no.id])[0][1]
2207
2207
            dig = obj_multi.code_digits
2208
 
            new_code = str(current_num)
2209
2208
            if ref_acc_bank.code:
2210
 
                new_code = str(ref_acc_bank.code.ljust(dig,'0') + str(current_num))
 
2209
                try:
 
2210
                    new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num)
 
2211
                except Exception,e:
 
2212
                    new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num)
2211
2213
            vals = {
2212
2214
                'name': line.acc_no.bank and line.acc_no.bank.name+' '+tmp or tmp,
2213
2215
                'currency_id': line.currency_id and line.currency_id.id or False,