You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
408 B

  1. # Copyright 2020 Tecnativa - João Marques
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. from odoo import models
  4. class AccountBankStatementClearPartner(models.Model):
  5. _inherit = "account.bank.statement"
  6. def clear_partners(self):
  7. self.mapped("line_ids").filtered(
  8. lambda x: not x.journal_entry_ids and not x.account_id
  9. ).write({"partner_id": False})