~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to msf_budget/wizard/wizard_budget_import.py

  • Committer: jf
  • Date: 2014-01-13 13:44:46 UTC
  • mfrom: (1874.4.19 UTP_944)
  • Revision ID: jfb@tempo-consulting.fr-20140113134446-qm119dxl1gdqoxzc
UTP-944 [IMP] Impossible to link income account to destination
lp:~unifield-team/unifield-wm/UTP_944

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
                    raise osv.except_osv(_('Warning !'), _("Account/destination %s/%s is twice in the file!")%(account_codes[0], account_codes[1]))
145
145
                # Test account data
146
146
                account = self.pool.get('account.account').browse(cr,uid,account_ids[0], context=context)
147
 
                if account.user_type_code != 'expense':
148
 
                    raise osv.except_osv(_('Warning !'), _("Account %s is not an expense account!") % (account_codes[0],))
 
147
                if not account.is_analytic_addicted:
 
148
                    raise osv.except_osv(_('Warning !'), _("Account %s is not an analytic-a-holic account!") % (account_codes[0],))
149
149
                # Only create "destination" budget lines
150
150
                budget_line_vals.update({'account_id': account_ids[0],
151
151
                                         'destination_id': destination_ids[0],
168
168
                # Update created lines dictionary
169
169
                created_lines[destination_link_ids[0]] = True
170
170
                result.append(budget_line_vals)
171
 
        # If expense accounts are not in the file, create those
 
171
        # If analytic-a-holic accounts are not in the file, create those
172
172
        missing_lines = [x for x in created_lines if created_lines[x] == False]
173
173
        budget_values = str([0]*12)
174
174
        for destination_link_id in missing_lines: