(self)
return self.env['website'].search(domain, limit=1)
Find the first company's website, if there is one.
Find the first company's website, if there is one.
Find the first company s website if there is one .
def _default_website(self):
        """ Find the first company's website, if there is one. """
        company_id = self.env.company.id

        if self._context.get('default_company_id'):
            company_id = self._context.get('default_company_id')

        domain = [('company_id', '=', company_id)]
        return self.env['website'].search(domain, limit=1)
def _default_website ( self ) : company_id = self . env . company . id if self . _context . get ( 'default_company_id' ) : company_id = self . _context . get ( 'default_company_id' ) domain = [ ( 'company_id' , '=' , company_id ) ] return self . env [ 'website' ] . search ( domain , limit = 1 )