mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
This module allows to mark invoices as "selected for payment". This can be done in the list view of invoices using a button in the first column of the view which shows the selection status. This selection persists until a payment is registered.
19 lines
570 B
Python
19 lines
570 B
Python
# Copyright 2020 Camptocamp
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class AccountMove(models.Model):
|
|
_inherit = "account.move"
|
|
|
|
selected_for_payment = fields.Boolean("To Pay")
|
|
|
|
def action_toggle_select_for_payment(self):
|
|
selected = self.filtered(lambda rec: rec.selected_for_payment)
|
|
unselected = self - selected
|
|
if selected:
|
|
selected.write({"selected_for_payment": False})
|
|
if unselected:
|
|
unselected.write({"selected_for_payment": True})
|