Update rent_payment.py
This commit is contained in:
parent
055f8045b9
commit
15192124d6
|
|
@ -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'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue