Merge pull request #1619 from expsa/odex25_realstate_dev
update access rights in rental payment
This commit is contained in:
commit
13a2686e9d
|
|
@ -204,7 +204,7 @@ class RentPayment(models.Model):
|
||||||
def create_vendor_bill_for_payments(self):
|
def create_vendor_bill_for_payments(self):
|
||||||
active_ids = self._context.get('active_ids', [])
|
active_ids = self._context.get('active_ids', [])
|
||||||
# action = self.env['rent.payment'].browse(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)
|
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'))
|
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'))
|
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."))
|
raise UserError(_("Vendor or Account not configured properly in settings."))
|
||||||
|
|
||||||
if payments_to_invoice:
|
if payments_to_invoice:
|
||||||
vendor_bill = self.env['account.move'].create({
|
vendor_bill = self.env['account.move'].sudo().create({
|
||||||
'move_type': 'in_invoice',
|
'move_type': 'in_invoice',
|
||||||
'invoice_date': today_date, # Set the invoice date,
|
'invoice_date': today_date, # Set the invoice date,
|
||||||
'partner_id': vendor_id,
|
'partner_id': vendor_id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue