from odoo import models, fields, _


class HmsBankPayments(models.Model):
    _name = 'hms.bank.payments'
    _description = 'Hms Bank Payments'
    _rec_name = 'booking_id'

    bank_payment_id = fields.Many2one(comodel_name="brosse.bank.deposits", string="Bank Payment ID")
    booking_id = fields.Many2one(comodel_name="hms.bookings", string="Booking ID")

    currency_id = fields.Many2one(comodel_name="res.currency", string="Currency")
    amount = fields.Monetary(string="Amount", currency_field='currency_id')
    amount_left = fields.Monetary(string="Left Amount", currency_field='currency_id')
    exchange_rate = fields.Float(string="Exchange Rate")
    notes = fields.Text(string="Notes")


class HmsBookings(models.Model):
    _inherit = 'hms.bookings'

    bank_payment_ids = fields.One2many(comodel_name="hms.bank.payments", inverse_name="booking_id", string="Booking Payments")
