Fix credit to copy analytic_accounts

issue1829
review130001
This commit is contained in:
Cédric Krier
2011-10-03 23:30:42 +02:00
parent 9d94fe8ea6
commit 8961e6b682
+10
View File
@@ -184,6 +184,16 @@ class InvoiceLine(ModelSQL, ModelView):
return new_ids[0]
return new_ids
def _credit(self, line):
selection_obj = Pool().get('analytic_account.account.selection')
result = super(InvoiceLine, self)._credit(line)
if line.analytic_accounts:
selection_id = selection_obj.copy(line.analytic_accounts.id)
result['analytic_accounts'] = selection_id
return result
def get_move_line(self, line):
values = super(InvoiceLine, self).get_move_line(line)
if line.analytic_accounts and line.analytic_accounts.accounts: