update access rights in rental payment
This commit is contained in:
parent
354c56bd26
commit
f0894b267d
|
|
@ -204,7 +204,7 @@ class RentPayment(models.Model):
|
|||
def create_vendor_bill_for_payments(self):
|
||||
active_ids = self._context.get('active_ids', [])
|
||||
# action = self.env['rent.payment'].browse(context.get('active_ids', []))
|
||||
payments_to_invoice = self.env['rent.payment'].browse(active_ids).filtered(
|
||||
payments_to_invoice = self.env['rent.payment'].sudo().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'].sudo().get_param('property_management.collecting_company_id'))
|
||||
account_id = int(self.env['ir.config_parameter'].sudo().get_param('property_management.commission_account_id'))
|
||||
|
|
@ -217,7 +217,7 @@ class RentPayment(models.Model):
|
|||
raise UserError(_("Vendor or Account not configured properly in settings."))
|
||||
|
||||
if payments_to_invoice:
|
||||
vendor_bill = self.env['account.move'].create({
|
||||
vendor_bill = self.env['account.move'].sudo().create({
|
||||
'move_type': 'in_invoice',
|
||||
'invoice_date': today_date, # Set the invoice date,
|
||||
'partner_id': vendor_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue