
from odoo import models, fields


class PrivacyStatementAgreement(models.Model):
    _inherit = 'privacy.statement.agreement'

    origin_signature = fields.Selection(
        selection_add=[('mobile_app', 'Mobile App Registration')])

    def mobile_get_privacy_notice(self, language, **params):
        return {'PrivacyNotice': self.env['compassion.privacy.statement']
                .with_context(lang=language)
                .sudo().search([], limit=1).text}

from ..controllers.mobile_app_controller import _get_lang
from odoo import models, fields


class PrivacyStatementAgreement(models.Model):
    _inherit = 'privacy.statement.agreement'

    origin_signature = fields.Selection(
        selection_add=[('mobile_app', 'Mobile App Registration')])

    def mobile_get_privacy_notice(self, **params):
        lang = _get_lang(self, params)
        return {'PrivacyNotice': self.env['compassion.privacy.statement']
                .with_context(lang=lang)
                .sudo().search([], limit=1).text}

FIX language of privacy statement
FIX language of privacy statement

- 
+ from ..controllers.mobile_app_controller import _get_lang
  from odoo import models, fields
  
  
  class PrivacyStatementAgreement(models.Model):
      _inherit = 'privacy.statement.agreement'
  
      origin_signature = fields.Selection(
          selection_add=[('mobile_app', 'Mobile App Registration')])
  
-     def mobile_get_privacy_notice(self, language, **params):
+     def mobile_get_privacy_notice(self, **params):
+         lang = _get_lang(self, params)
          return {'PrivacyNotice': self.env['compassion.privacy.statement']
-                 .with_context(lang=language)
+                 .with_context(lang=lang)
                  .sudo().search([], limit=1).text}
  
FIX language of privacy statement
## Code Before:

from odoo import models, fields


class PrivacyStatementAgreement(models.Model):
    _inherit = 'privacy.statement.agreement'

    origin_signature = fields.Selection(
        selection_add=[('mobile_app', 'Mobile App Registration')])

    def mobile_get_privacy_notice(self, language, **params):
        return {'PrivacyNotice': self.env['compassion.privacy.statement']
                .with_context(lang=language)
                .sudo().search([], limit=1).text}

## Instruction:
FIX language of privacy statement
## Code After:
from ..controllers.mobile_app_controller import _get_lang
from odoo import models, fields


class PrivacyStatementAgreement(models.Model):
    _inherit = 'privacy.statement.agreement'

    origin_signature = fields.Selection(
        selection_add=[('mobile_app', 'Mobile App Registration')])

    def mobile_get_privacy_notice(self, **params):
        lang = _get_lang(self, params)
        return {'PrivacyNotice': self.env['compassion.privacy.statement']
                .with_context(lang=lang)
                .sudo().search([], limit=1).text}
