from odoo import models, fields, api

class Business_performanceWizard(models.TransientModel):
    _name = 'sos_business_performance_wizard'
    _description = 'Business Performance Wizard'

    sales_person_id = fields.Many2one(
        'res.users', 
        string='Sales Executive', 
        default=lambda self: self.env.user,
        domain=lambda self: [('groups_id', 'in', self.env.ref('sos_inventory.sos_sales_user').ids + self.env.ref('sos_inventory.sos_ce_head').ids)]
    )

    def print_report(self):
        return self.env.ref('sos_sales.action_business_performance_report_custom').report_action(self, data={
            'sales_person_id': self.sales_person_id.id if self.sales_person_id else False
        })
        