parameters: (self)
return_statement: return True
docstring: Writes repair order state to 'To be invoiced' if invoice method is
          After repair else state is set to 'Ready'.
          @return: True
docstring_summary: Writes repair order state to 'To be invoiced' if invoice method is
          After repair else state is set to 'Ready'.
docstring_tokens: Writes repair order state to To be invoiced if invoice method is After repair else state is set to Ready .
function: def action_repair_end(self):
          """ Writes repair order state to 'To be invoiced' if invoice method is
          After repair else state is set to 'Ready'.
          @return: True
          """
          if self.filtered(lambda repair: repair.state != 'under_repair'):
              raise UserError(_("Repair must be under repair in order to end reparation."))
          self._check_product_tracking()
          for repair in self:
              repair.write({'repaired': True})
              vals = {'state': 'done'}
              vals['move_id'] = repair.action_repair_done().get(repair.id)
              if not repair.invoice_id and repair.invoice_method == 'after_repair':
                  vals['state'] = '2binvoiced'
              repair.write(vals)
          return True
function_tokens: def action_repair_end ( self ) : if self . filtered ( lambda repair : repair . state != 'under_repair' ) : raise UserError ( _ ( "Repair must be under repair in order to end reparation." ) ) self . _check_product_tracking ( ) for repair in self : repair . write ( { 'repaired' : True } ) vals = { 'state' : 'done' } vals [ 'move_id' ] = repair . action_repair_done ( ) . get ( repair . id ) if not repair . invoice_id and repair . invoice_method == 'after_repair' : vals [ 'state' ] = '2binvoiced' repair . write ( vals ) return True