Update rent_payment.py

This commit is contained in:
zainab2097 2024-09-03 12:47:23 +03:00 committed by GitHub
parent 055f8045b9
commit 15192124d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -200,8 +200,11 @@ class RentPayment(models.Model):
raise exceptions.ValidationError(_('Cannot Cancel This Payment Because it Due'))
def create_vendor_bill_for_payments(self):
action = self.env['rent.payment'].browse(context.get('active_ids', []))
payments_to_invoice = action.filtered(lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
active_ids = self._context.get('active_ids', [])
# action = self.env['rent.payment'].browse(context.get('active_ids', []))
# payments_to_invoice = action.filtered(lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
payments_to_invoice = self.env['rent.payment'].browse(active_ids).filtered(
lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
vendor_id = self.env['ir.config_parameter'].get_param('property_management.collecting_company_id')
account_id = self.env['ir.config_parameter'].get_param('property_management.commission_account_id ')
total_commission_amount = sum(payments_to_invoice.mapped('commission_amount'))