diff --git a/pms/models/account_payment.py b/pms/models/account_payment.py index f092620da9..a481629a74 100644 --- a/pms/models/account_payment.py +++ b/pms/models/account_payment.py @@ -206,7 +206,9 @@ def _create_downpayment_invoice(self, payment, partner_id): ): group[(line.account_id, line.currency_id)].append(line.id) for (account, _dummy), line_ids in group.items(): - if account.reconcile or account.internal_type == "liquidity": + if ( + account.reconcile or account.account_type == "liquidity" + ): # TODO: liquidity not in account.account_type self.env["account.move.line"].browse(line_ids).reconcile() # Set folio sale lines default_invoice_to to partner downpayment invoice for folio in payment.folio_ids: diff --git a/pms/models/pms_folio.py b/pms/models/pms_folio.py index 8d51ae8c1e..a7e2689d7c 100644 --- a/pms/models/pms_folio.py +++ b/pms/models/pms_folio.py @@ -1259,7 +1259,7 @@ def _compute_amount(self): record.payment_ids.filtered(lambda pay: len(pay.folio_ids) == 1) .mapped("move_id.line_ids") .filtered( - lambda x: x.account_id.internal_type == "receivable" + lambda x: x.account_id.account_type == "asset_receivable" and x.parent_state == "posted" ) ) @@ -1273,7 +1273,7 @@ def _compute_amount(self): mls_multi_folio = folios.payment_ids.mapped( "move_id.line_ids" ).filtered( - lambda x: x.account_id.internal_type == "receivable" + lambda x: x.account_id.account_type == "asset_receivable" and x.parent_state == "posted" ) if mls_multi_folio: @@ -1311,7 +1311,7 @@ def _get_amount_vals(self, mls, advance_amount, folio_ids=False): self.payment_ids.filtered(lambda pay: len(pay.folio_ids) == 1) .mapped("move_id.line_ids") .filtered( - lambda x: x.account_id.internal_type == "receivable" + lambda x: x.account_id.internal_type == "asset_receivable" and x.parent_state == "posted" ) )