[FIX] test error on multi action_move_create
This commit is contained in:
parent
3b92b3dca6
commit
19c6516857
@ -19,15 +19,6 @@ class AccountInvoice(models.Model):
|
||||
ondelete='restrict',
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def action_move_create(self):
|
||||
if self.loan_line_id:
|
||||
return super(AccountInvoice, self.with_context(
|
||||
default_loan_line_id=self.loan_line_id.id,
|
||||
default_loan_id=self.loan_id.id,
|
||||
)).action_move_create()
|
||||
return super().action_move_create()
|
||||
|
||||
@api.multi
|
||||
def finalize_invoice_move_lines(self, move_lines):
|
||||
vals = super().finalize_invoice_move_lines(move_lines)
|
||||
|
@ -23,8 +23,13 @@ class AccountMove(models.Model):
|
||||
def post(self, invoice=False):
|
||||
res = super().post(invoice=invoice)
|
||||
for record in self:
|
||||
if record.loan_line_id:
|
||||
record.loan_id = record.loan_line_id.loan_id
|
||||
loan_line_id = record.loan_line_id or (
|
||||
invoice and invoice.loan_line_id
|
||||
)
|
||||
if loan_line_id:
|
||||
if not record.loan_line_id:
|
||||
record.loan_line_id = loan_line_id
|
||||
record.loan_id = loan_line_id.loan_id
|
||||
record.loan_line_id.check_move_amount()
|
||||
record.loan_line_id.loan_id.compute_posted_lines()
|
||||
if record.loan_line_id.sequence == record.loan_id.periods:
|
||||
|
Loading…
Reference in New Issue
Block a user