Esempio n. 1
0
 def add_checkpoint(self, record):
     self.ensure_one()
     record.ensure_one()
     return checkpoint.add_checkpoint(
         self.env,
         record._name,
         record.id,
         self._name,
         self.id,
     )
Esempio n. 2
0
 def add_checkpoint(self, record, message=''):
     """
     @param message: used with this
     https://github.com/OCA/connector/issues/37
     """
     self.ensure_one()
     record.ensure_one()
     chk_point = checkpoint.add_checkpoint(self.env, record._name,
                                           record.id, self._name, self.id)
     if message:
         chk_point.message_post(body=message)
     return chk_point
def add_checkpoint(session, model_name, record_id, backend_id):
    """ Add a row in the model ``connector.checkpoint`` for a record,
    meaning it has to be reviewed by a user.
    :param session: current session
    :type session: :class:`odoo.addons.connector.session.ConnectorSession`
    :param model_name: name of the model of the record to be reviewed
    :type model_name: str
    :param record_id: ID of the record to be reviewed
    :type record_id: int
    :param backend_id: ID of the Easypost Backend
    :type backend_id: int
    """
    return checkpoint.add_checkpoint(session, model_name, record_id,
                                     'easypost.backend', backend_id)