Add partner in move lines
This commit is contained in:
parent
0d9b82f4f9
commit
117e80f381
@ -94,6 +94,7 @@ class AccountInvoiceSpreadLine(models.Model):
|
||||
'account_id': spread.debit_account_id.id,
|
||||
'debit': amount if amount > 0.0 else 0.0,
|
||||
'credit': -amount if amount < 0.0 else 0.0,
|
||||
'partner_id': self.spread_id.invoice_id.partner_id.id,
|
||||
'analytic_account_id': analytic.id,
|
||||
'analytic_tag_ids': analytic_tags,
|
||||
'currency_id': not_same_curr and current_currency.id or False,
|
||||
@ -103,6 +104,7 @@ class AccountInvoiceSpreadLine(models.Model):
|
||||
'account_id': spread.credit_account_id.id,
|
||||
'credit': amount if amount > 0.0 else 0.0,
|
||||
'debit': -amount if amount < 0.0 else 0.0,
|
||||
'partner_id': self.spread_id.invoice_id.partner_id.id,
|
||||
'analytic_account_id': analytic.id,
|
||||
'analytic_tag_ids': analytic_tags,
|
||||
'currency_id': not_same_curr and current_currency.id or False,
|
||||
|
@ -512,10 +512,8 @@ class TestAccountInvoiceSpread(common.TransactionCase):
|
||||
invoice_mls = self.invoice.move_id.mapped('line_ids')
|
||||
self.assertTrue(invoice_mls)
|
||||
|
||||
count_balance_sheet = 0
|
||||
for invoice_ml in invoice_mls:
|
||||
if invoice_ml.account_id == balance_sheet:
|
||||
count_balance_sheet += 1
|
||||
count_balance_sheet = len(invoice_mls.filtered(
|
||||
lambda x: x.account_id == balance_sheet))
|
||||
self.assertEqual(count_balance_sheet, 1)
|
||||
|
||||
self.spread.line_ids.create_and_reconcile_moves()
|
||||
@ -572,10 +570,8 @@ class TestAccountInvoiceSpread(common.TransactionCase):
|
||||
invoice_mls = self.invoice.move_id.mapped('line_ids')
|
||||
self.assertTrue(invoice_mls)
|
||||
|
||||
count_balance_sheet = 0
|
||||
for invoice_ml in invoice_mls:
|
||||
if invoice_ml.account_id == balance_sheet:
|
||||
count_balance_sheet += 1
|
||||
count_balance_sheet = len(invoice_mls.filtered(
|
||||
lambda x: x.account_id == balance_sheet))
|
||||
self.assertEqual(count_balance_sheet, 1)
|
||||
|
||||
self.spread.company_id.force_move_auto_post = True
|
||||
|
Loading…
Reference in New Issue
Block a user