Skip to content

Commit

Permalink
[TMP]pms: account field account_type
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Oct 17, 2024
1 parent f661e99 commit f2c04f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pms/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions pms/models/pms_folio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
Expand All @@ -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:
Expand Down Expand Up @@ -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"
)
)
Expand Down

0 comments on commit f2c04f9

Please sign in to comment.