79264555

Date: 2024-12-09 10:09:44
Score: 1.5
Natty:
Report link

I know I'm far late. I encounter the same situation. Which when I want to print report from other model, the report is empty

Here is my solution without making additional method on the target class

class HrContract(models.Model):
    _inherit = 'hr.contract'

    def print_nominee_report(self):
        account_payment_id = 1

        model = self.env['account.payment'].browse(account_payment_id)
        return model.env.ref('account.action_report_xxxxx').report_action(model)
Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: odoo dimas