Merge pull request #1037 from expsa/property_security
Update rent_payment.py
This commit is contained in:
commit
5831e50f0a
|
|
@ -215,21 +215,18 @@ class RentPayment(models.Model):
|
|||
if not vendor_id or not account_id:
|
||||
raise UserError(_("Vendor or Account not configured properly in settings."))
|
||||
|
||||
# if payments_to_invoice:
|
||||
vendor_bill = self.env['account.move'].create({
|
||||
'move_type': 'in_invoice',
|
||||
'invoice_date': today_date, # Set the invoice date,
|
||||
'partner_id': vendor_id,
|
||||
'invoice_line_ids': [(0, 0, {
|
||||
'name': name+' - '+str(today_date),
|
||||
'quantity': 1,
|
||||
'price_unit': total_commission_amount,
|
||||
'account_id': account_id
|
||||
})],
|
||||
})
|
||||
# else:
|
||||
# raise UserError(_("No eligible payments selected. there are payment not valid conditions"))
|
||||
|
||||
if payments_to_invoice:
|
||||
vendor_bill = self.env['account.move'].create({
|
||||
'move_type': 'in_invoice',
|
||||
'invoice_date': today_date, # Set the invoice date,
|
||||
'partner_id': vendor_id,
|
||||
'invoice_line_ids': [(0, 0, {
|
||||
'name': name+' - '+str(today_date),
|
||||
'quantity': 1,
|
||||
'price_unit': total_commission_amount,
|
||||
'account_id': account_id
|
||||
})],
|
||||
})
|
||||
for payment in payments_to_invoice:
|
||||
payment.invoice_commission_id = vendor_bill.id
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue