addons14/contract/models/contract_line.py
def _check_allowed(self):
        """
        logical impossible combination:
            * a line with is_auto_renew True should have date_end and
              couldn't have successor_contract_line_id
            * a line without date_end can't have successor_contract_line_id

        """
        for rec in self:
            if rec.is_auto_renew:
                if rec.successor_contract_line_id:
                    raise ValidationError(
                        _(
                            "A contract line with a successor "
                            "can't be set to auto-renew"
                        )
                    )
                if not rec.date_end:
                    raise ValidationError(_("An auto-renew line must have a end date"))
            else:
                if not rec.date_end and rec.successor_contract_line_id:
                    raise ValidationError(
                        _("A contract line with a successor " "must have a end date")
                    )

        logical impossible combination:
            * a line with is_auto_renew True should have date_end and
              couldn't have successor_contract_line_id
            * a line without date_end can't have successor_contract_line_id

        
logical impossible combination:
a line with is_auto_renew True should have date_end and
couldn't have successor_contract_line_id
a line without date_end can't have successor_contract_line_id
logical impossible combination : a line with is_auto_renew True should have date_end and couldn ' t have successor_contract_line_id a line without date_end can ' t have successor_contract_line_id
def _check_allowed(self):
        for rec in self:
            if rec.is_auto_renew:
                if rec.successor_contract_line_id:
                    raise ValidationError(
                        _(
                            "A contract line with a successor "
                            "can't be set to auto-renew"
                        )
                    )
                if not rec.date_end:
                    raise ValidationError(_("An auto-renew line must have a end date"))
            else:
                if not rec.date_end and rec.successor_contract_line_id:
                    raise ValidationError(
                        _("A contract line with a successor " "must have a end date")
                    )
def _check_allowed ( self ) : for rec in self : if rec . is_auto_renew : if rec . successor_contract_line_id : raise ValidationError ( _ ( "A contract line with a successor " "can't be set to auto-renew" ) ) if not rec . date_end : raise ValidationError ( _ ( "An auto-renew line must have a end date" ) ) else : if not rec . date_end and rec . successor_contract_line_id : raise ValidationError ( _ ( "A contract line with a successor " "must have a end date" ) )
logical impossible combination:
 a line with is_auto_renew True should have date_end and
couldn't have successor_contract_line_id
 a line without date_end can't have successor_contract_line_id
logical impossible combination : a line with is_auto_renew True should have date_end and couldn ' t have successor_contract_line_id a line without date_end can ' t have successor_contract_line_id
"""
        logical impossible combination:
            * a line with is_auto_renew True should have date_end and
              couldn't have successor_contract_line_id
            * a line without date_end can't have successor_contract_line_id

        """
self