Merge pull request #1010 from expsa/zainab2097-patch-6
Update rent_payment.py
This commit is contained in:
commit
e922ef35ad
|
|
@ -206,8 +206,8 @@ class RentPayment(models.Model):
|
|||
# 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 = int(self.env['ir.config_parameter'].get_param('property_management.collecting_company_id'))
|
||||
account_id = int(self.env['ir.config_parameter'].get_param('property_management.commission_account_id '))
|
||||
vendor_id = int(self.env['ir.config_parameter'].sudo().get_param('property_management.collecting_company_id'))
|
||||
account_id = int(self.env['ir.config_parameter'].sudo().get_param('property_management.commission_account_id '))
|
||||
total_commission_amount = sum(payments_to_invoice.mapped('commission_amount'))
|
||||
today_date = datetime.today().strftime('%Y-%m-%d')
|
||||
name = (_('Commission for selected payments'))
|
||||
|
|
@ -217,7 +217,7 @@ class RentPayment(models.Model):
|
|||
|
||||
vendor_bill = self.env['account.move'].create({
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': vendor_id.id,
|
||||
'partner_id': vendor_id,
|
||||
'invoice_line_ids': [(0, 0, {
|
||||
'name': name+' - '+str(today_date),
|
||||
'quantity': 1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue