addons14/contract/models/contract_line.py
def stop(self, date_end, manual_renew_needed=False, post_message=True):
        """
        Put date_end on contract line
        We don't consider contract lines that end's before the new end date
        :param date_end: new date end for contract line
        :return: True
        """
        if not all(self.mapped("is_stop_allowed")):
            raise ValidationError(_("Stop not allowed for this line"))
        for rec in self:
            if date_end < rec.date_start:
                rec.cancel()
            else:
                if not rec.date_end or rec.date_end > date_end:
                    old_date_end = rec.date_end
                    rec.write(
                        rec._prepare_value_for_stop(date_end, manual_renew_needed)
                    )
                    if post_message:
                        msg = _(
                            """Contract line for <strong>{product}</strong>
                            stopped: <br/>
                            - <strong>End</strong>: {old_end} -- {new_end}
                            """.format(
                                product=rec.name,
                                old_end=old_date_end,
                                new_end=rec.date_end,
                            )
                        )
                        rec.contract_id.message_post(body=msg)
                else:
                    rec.write(
                        {
                            "is_auto_renew": False,
                            "manual_renew_needed": manual_renew_needed,
                        }
                    )
        return True

        Put date_end on contract line
        We don't consider contract lines that end's before the new end date
        :param date_end: new date end for contract line
        :return: True
        
Put date_end on contract line
We don't consider contract lines that end's before the new end date
Put date_end on contract line We don ' t consider contract lines that end ' s before the new end date
def stop(self, date_end, manual_renew_needed=False, post_message=True):
        if not all(self.mapped("is_stop_allowed")):
            raise ValidationError(_("Stop not allowed for this line"))
        for rec in self:
            if date_end < rec.date_start:
                rec.cancel()
            else:
                if not rec.date_end or rec.date_end > date_end:
                    old_date_end = rec.date_end
                    rec.write(
                        rec._prepare_value_for_stop(date_end, manual_renew_needed)
                    )
                    if post_message:
                        msg = _(
                            """Contract line for <strong>{product}</strong>
                            stopped: <br/>
                            - <strong>End</strong>: {old_end} -- {new_end}
                            """.format(
                                product=rec.name,
                                old_end=old_date_end,
                                new_end=rec.date_end,
                            )
                        )
                        rec.contract_id.message_post(body=msg)
                else:
                    rec.write(
                        {
                            "is_auto_renew": False,
                            "manual_renew_needed": manual_renew_needed,
                        }
                    )
        return True
def stop ( self , date_end , manual_renew_needed = False , post_message = True ) : if not all ( self . mapped ( "is_stop_allowed" ) ) : raise ValidationError ( _ ( "Stop not allowed for this line" ) ) for rec in self : if date_end < rec . date_start : rec . cancel ( ) else : if not rec . date_end or rec . date_end > date_end : old_date_end = rec . date_end rec . write ( rec . _prepare_value_for_stop ( date_end , manual_renew_needed ) ) if post_message : msg = _ ( """Contract line for <strong>{product}</strong>
                            stopped: <br/>
                            - <strong>End</strong>: {old_end} -- {new_end}
                            """ . format ( product = rec . name , old_end = old_date_end , new_end = rec . date_end , ) ) rec . contract_id . message_post ( body = msg ) else : rec . write ( { "is_auto_renew" : False , "manual_renew_needed" : manual_renew_needed , } ) return True
Put date_end on contract line
We don't consider contract lines that end's before the new end date
Put date_end on contract line We don ' t consider contract lines that end ' s before the new end date
"""
        Put date_end on contract line
        We don't consider contract lines that end's before the new end date
        :param date_end: new date end for contract line
        :return: True
        """
None
self
date_end
new date end for contract line
new date end for contract line
manual_renew_needed
post_message